diff src/share/vm/opto/phaseX.cpp @ 17936:968a17f18337

8042786: Proper fix for 8032566 Summary: Check for overflow cases in range checks and collapse it if we can. Reviewed-by: jrose, iveresov
author kvn
date Fri, 16 May 2014 12:05:14 -0700
parents de95063c0e34
children 1555c0843770
line wrap: on
line diff
--- a/src/share/vm/opto/phaseX.cpp	Thu May 15 18:23:26 2014 -0400
+++ b/src/share/vm/opto/phaseX.cpp	Fri May 16 12:05:14 2014 -0700
@@ -1379,6 +1379,15 @@
           _worklist.push(u);
       }
     }
+    // If changed AddI/SubI inputs, check CmpU for range check optimization.
+    if (use_op == Op_AddI || use_op == Op_SubI) {
+      for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
+        Node* u = use->fast_out(i2);
+        if (u->is_Cmp() && (u->Opcode() == Op_CmpU)) {
+          _worklist.push(u);
+        }
+      }
+    }
     // If changed AddP inputs, check Stores for loop invariant
     if( use_op == Op_AddP ) {
       for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {