< prev index next >

src/hotspot/share/opto/compile.cpp

Print this page

        

@@ -4648,11 +4648,11 @@
 }
 
 Node* Compile::optimize_acmp(PhaseGVN* phase, Node* a, Node* b) {
   if (a->is_ValueType() || b->is_ValueType()) {
     // Return constant false because one operand is a non-null value type
-    return phase->intcon(1);
+    return new CmpINode(phase->intcon(0), phase->intcon(1)); // We need to return a new node
   }
   const TypeInstPtr* ta = phase->type(a)->isa_instptr();
   const TypeInstPtr* tb = phase->type(b)->isa_instptr();
   if (!EnableValhalla || phase->type(a)->is_zero_type() || phase->type(b)->is_zero_type()) {
     // Use old acmp if new acmp is disabled or degraded to a null check

@@ -4661,11 +4661,11 @@
     // We statically know that one operand is a value. Therefore,
     // new acmp will only return true if both operands are NULL.
     if ((ta != NULL && !TypePtr::NULL_PTR->higher_equal(ta)) ||
         (tb != NULL && !TypePtr::NULL_PTR->higher_equal(tb))) {
       // One operand is never NULL, fold to constant false
-      return phase->intcon(1);
+      return new CmpINode(phase->intcon(0), phase->intcon(1)); // We need to return a new node
     } else {
       // Check if both operands are null by or'ing the oops
       a = phase->transform(new CastP2XNode(NULL, a));
       b = phase->transform(new CastP2XNode(NULL, b));
       a = phase->transform(new OrXNode(a, b));
< prev index next >