JDK-8159715 : Fix for 8072422 is incorrect
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-06-16
  • Updated: 2024-07-02
  • Resolved: 2016-06-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b127Fixed
Related Reports
Relates :  
Description
The fix for JDK-8072422 changed the following lines in loopTransform.cpp

@@ -2258,7 +2203,7 @@
           add_constraint( stride_con, scale_con, offset, zero, limit, pre_ctrl, &pre_limit, &main_limit );
           if (!conditional_rc) {
             // (0-offset)/scale could be outside of loop iterations range.
-            conditional_rc = !loop->dominates_backedge(iff) || RangeLimitCheck;
+            conditional_rc = !loop->dominates_backedge(iff);
           }
         } else {
           if (PrintOpto) {
@@ -2294,7 +2239,7 @@
             // ((MIN_INT+1)-offset)/scale could be outside of loop iterations range.
             // Note: negative offset is replaced with 0 but (MIN_INT+1)/scale could
             // still be outside of loop range.
-            conditional_rc = !loop->dominates_backedge(iff) || RangeLimitCheck;
+            conditional_rc = !loop->dominates_backedge(iff);
           }
           break;
         default:

Both changes are incorrect because if RangeLimitCheck is always true, conditional_rc should be always true as well.

There is also the following change in parse1.cpp:

@@ -661,8 +661,7 @@
         // (Note that dead locals do not get phis built, ever.)
         ensure_phis_everywhere();
 
-        if (block->is_SEL_head() &&
-            (UseLoopPredicate || LoopLimitCheck)) {
+        if (block->is_SEL_head() && UseLoopPredicate) {
           // Add predicate to single entry (not irreducible) loop head.
           assert(!block->has_merged_backedge(), "only entry paths should be merged for now");
           // Need correct bci for predicate.

The "&& UseLoopPredicate" should be removed because the original statement is always true if LoopLimitCheck == true.

And this change in loopnode.cpp

@@ -2322,7 +2221,7 @@
   // Some parser-inserted loop predicates could never be used by loop
   // predication or they were moved away from loop during some optimizations.
   // For example, peeling. Eliminate them before next loop optimizations.
-  if (UseLoopPredicate || LoopLimitCheck) {
+  if (UseLoopPredicate) {
     eliminate_useless_predicates();
   }

The if should be removed.
Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/c23bf7df628c User: amurillo Date: 2016-07-08 20:16:41 +0000
08-07-2016

URL: http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/rev/c23bf7df628c User: thartmann Date: 2016-06-20 09:15:31 +0000
20-06-2016

Fix: http://cr.openjdk.java.net/~thartmann/8159715/webrev.00/
16-06-2016

ILW = incorrect code in compiler, never caused any problems, no workaround = MLH = P4
16-06-2016