JDK-8255033 : VerifyLoopOptimizations fails because split_if_with_blocks may introduces a new conI node
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 16
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2020-10-19
  • Updated: 2020-12-22
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.
Other
tbdUnresolved
Related Reports
Blocks :  
Description
VerifyLoopOptimizations fails because split_if_with_blocks may introduces a new conI node. 

it's one of problems causes JDK-8173709. 
we observe error message like this: 

Verify has that we do not:  172  ConI  ===  0  [[ 131 ]]  #int:1
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/loopnode.cpp:3590
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/backup/skara/jdk/src/hotspot/share/opto/loopnode.cpp:3590), pid=21036, tid=21051
#  assert(!fail) failed: loop body mismatch
#
# JRE version: OpenJDK Runtime Environment (16.0) (fastdebug build 16-internal+0-adhoc.ubuntu.jdk)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 16-internal+0-adhoc.ubuntu.jdk, mixed mode, sharing, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x116fd9a]  IdealLoopTree::verify_tree(IdealLoopTree*, IdealLoopTree const*) const+0x62a
Comments
Right, it would definitely be nice to have VerifyLoopOptimizations working but I'm afraid it's a lot of work. [~jcm] already worked quite a bit on JDK-8173709, he should know more. In any case, I would suggest to file subtasks of JDK-8173709 if you want to split up the work.
22-10-2020

I think it's a good idea to fix it instead of ditching it. don't you think IdealLoopTree::verify_tree() useful? indeed, a variety of reasons. I ran into multiple reasons even for 'java -version'. let alone the whole jtreg test. for me, it's hard to estimate how much time/effort to fix JDK-8173709 completely. I would like to break it down and solve it gradually when I known more about loopopt.
20-10-2020

ILW = Same as JDK-8173709 = P4
20-10-2020

There are lots of issues with the VerifyLoopOptimizations flag (see JDK-8173709). Is it really worth fixing one of them individually? I think the flag should either be removed or fixed as a whole.
20-10-2020

/* * @test * @key randomness * @library /test/lib * @bug 8255033 * @summary split_if_blocks may introduces a new conI node. c2 can't pass Verify_Tree * until it synces up this new node to loop->_body * * @run main/othervm -XX:-TieredCompilation -XX:CompileOnly=java.lang.String::charAt -XX:CompileOnly=java.lang.String::isLatin1 -XX:CompileOnly=java.lang.StingLatin1.charAt -XX:+VerifyLoopOptimizations compiler.loopopts.TestVerifyLoopOpts * @author Xin Liu xxinliu@amazon.com */ package compiler.loopopts; import java.util.Random; import jdk.test.lib.Asserts; public class TestVerifyLoopOpts { public static void main(String[] args) { test_string_charAt(); } public static void test_string_charAt() { char[] letters = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'}; Random rand = new Random(); String str = new String(letters); for (int i = 0; i < 1_0000_000; i++) { int j = rand.nextInt(letters.length); Asserts.assertEquals(str.charAt(j), letters[j], "wrong results"); } } }
19-10-2020