JDK-8306922 : IR verification fails because IR dump is chopped up
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-04-26
  • Updated: 2024-01-17
  • Resolved: 2023-06-26
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 21 JDK 22
21.0.3-oracleFixed 22 b04Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8308758 :  
Description
Compilation of Failed Method
----------------------------
1) Compilation of "public long compiler.c2.irTests.DivLNodeIdealizationTests.retainDenominator(long,long)":
> Phase "PrintIdeal":
AFTER: print_ideal
  0  Root  === 0 40 42  [[ 0 1 3 27 35 ]] inner 
  1  Con  === 0  [[ ]]  #top
  3  Start  === 3 0  [[ 3 5 6 7 8 9 13 11 ]]  #{0:control, 1:abIO, 2:memory, 3:rawptr:BotPTR, 4:return_address, 5:compiler/c2/irTests/DivLNodeIdealizationTests:NotNull *, 6:long, 7:half, 8:long, 9:half}
  5  Parm  === 3  [[ 32 ]] Control !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:-1 (line 130)
  6  Parm  === 3  [[ 42 36 ]] I_O !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:-1 (line 130)
  7  Parm  === 3  [[ 42 36 ]] Memory  Memory: @BotPTR *+bot, idx=Bot; !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:-1 (line 130)
  8  Parm  === 3  [[ 42 40 36 ]] FramePtr !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:-1 (line 130)
  9  Parm  === 3  [[ 42 36 ]] ReturnAdr !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:-1 (line 130)
 11  Parm  === 3  [[ 26 ]] Parm1: long !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:-1 (line 130)
 13  Parm  === 3  [[ 41 26 28 ]] Parm3: long !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:-1 (line 130)
 26  MulL  === _ 11 13  [[ 41 36 ]]  !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:2 (line 130)
 27  ConL  === 0  [[ 28 36 ]]  #long:0
 28  CmpL  === _ 13 27  [[ 29 ]]  !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:4 (line 130)
 29  Bool  === _ 28  [[ 32 ]] [ne] !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:4 (line 130)
 32  If  === 5 29  [[ 33 34 ]] P=0.999999, C=-1.000000 !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:4 (line 130)
 33  IfTrue  === 32  [[ 42 41 ]] #1 !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:4 (line 130)
 34  IfFalse  === 32  [[ 36 ]] #0 !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:4 (line 130)
 35  ConI  === 0  [[ 36 ]]  #int:-122
 36  CallStaticJava  === 34 
6
 
7 8 9 (35 1 1 1 1 1 26 1 27 1 ) [[ 37 ]] # Static uncommon_trap(reason='div0_check' action='maybe_recompile' debug_id='0')  void ( int ) C=0.000100 DivLNodeIdealizationTests::retainDenominator @ bci:4 (line 130) !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:4 (line 130)
 37  Proj  === 
36  [[ 40 ]] #0 !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:4 (line 130)
 
40
  Halt  === 37 1 1 8 1  [[ 0 ]]  !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:4 (line 130)
 41  DivL  === 33 26 13  [[ 42 ]]  !jvms: DivLNodeIdealizationTests::retainDenominator @ bci:4 (line 130)
 42  Return  === 
33 6 7 8 9
 returns 41  [[ 0 ]] 

----------System.err:(45/5524)*----------

Command Line:
/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-21+20-1665/macosx-x64-debug.jdk/jdk-21/fastdebug/bin/java -DReproduce=true -cp /System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S42045/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/be2e90e5-fd60-4256-aeb3-bcd1754a68f6/runs/94c485b0-3e3b-40ca-bbeb-4ea77de014a5/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_1/classes/0/compiler/c2/irTests/DivLNodeIdealizationTests.d:/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-21+20-1665/src.full/open/test/hotspot/jtreg/compiler/c2/irTests:/System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S42045/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/be2e90e5-fd60-4256-aeb3-bcd1754a68f6/runs/94c485b0-3e3b-40ca-bbeb-4ea77de014a5/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_1/classes/0/test/lib:/System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S42045/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/be2e90e5-fd60-4256-aeb3-bcd1754a68f6/runs/94c485b0-3e3b-40ca-bbeb-4ea77de014a5/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_1/classes/0:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/7.2/1/bundles/jtreg-7.2+1.zip/jtreg/lib/jtreg.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/7.2/1/bundles/jtreg-7.2+1.zip/jtreg/lib/junit-platform-console-standalone-1.9.2.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/7.2/1/bundles/jtreg-7.2+1.zip/jtreg/lib/testng-7.3.0.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/7.2/1/bundles/jtreg-7.2+1.zip/jtreg/lib/jcommander-1.78.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/7.2/1/bundles/jtreg-7.2+1.zip/jtreg/lib/guice-4.2.3.jar -Djava.library.path=/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-21+20-1665/macosx-x64-debug.test/hotspot/jtreg/native -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:MaxRAMPercentage=12.5 -Dtest.boot.jdk=/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk/20/36/bundles/macos-x64/jdk-20_macos-x64_bin.tar.gz/jdk-20.jdk/Contents/Home -Djava.io.tmpdir=/System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S42045/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/be2e90e5-fd60-4256-aeb3-bcd1754a68f6/runs/94c485b0-3e3b-40ca-bbeb-4ea77de014a5/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_1/tmp -XX:+CreateCoredumpOnCrash -ea -esa -XX:+UnlockExperimentalVMOptions -server -XX:-TieredCompilation -Dir.framework.server.port=55927 -XX:+PrintCompilation -XX:+UnlockDiagnosticVMOptions -XX:+LogCompilation -XX:CompilerDirectivesFile=test-vm-compile-commands-pid-99155.log -XX:CompilerDirectivesLimit=101 -XX:-OmitStackTraceInFastThrow -DShouldDoIRVerification=true -XX:-BackgroundCompilation -XX:CompileCommand=quiet compiler.lib.ir_framework.test.TestVM compiler.c2.irTests.DivLNodeIdealizationTests

One or more @IR rules failed:

Failed IR Rules (1) of Methods (1)
----------------------------------
1) Method "public long compiler.c2.irTests.DivLNodeIdealizationTests.retainDenominator(long,long)" - [Failed IR rules: 1]:
   * @IR rule 1: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeatureOr={}, applyIfCPUFeature={}, counts={"_#MUL_L#_", "1", "_#DIV_L#_", "1", "_#DIV_BY_ZERO_TRAP#_", "1"}, failOn={}, applyIfAnd={}, applyIfOr={}, applyIfNot={})"
     > Phase "PrintIdeal":
       - counts: Graph contains wrong number of nodes:
         * Constraint 3: "(\\d+(\\s){2}(CallStaticJava.*)+(\\s){2}===.*uncommon_trap.*div0_check)"
           - Failed comparison: [found] 0 = 1 [given]
           - No nodes matched!

>>> Check stdout for compilation output of the failed methods
Comments
Fix request [21u] I backport this for parity with 21.0.3-oracle. Low risk, only a test infra change, but that is built in to C2. Clean backport. Test passes and fails without the fix. SAP nightly testing passed.
16-01-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u-dev/pull/167 Date: 2024-01-15 14:10:28 +0000
15-01-2024

Changeset: 9057b350 Author: Emanuel Peter <epeter@openjdk.org> Date: 2023-06-26 06:11:32 +0000 URL: https://git.openjdk.org/jdk/commit/9057b3503349ead7d995b1a705317324830eabb2
26-06-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14591 Date: 2023-06-21 14:43:18 +0000
23-06-2023

[~chagedorn] and I discussed this. I will fix it. It currently blocks some of my work. Approach: dump_bfs can go to an arbitrary stream. By default tty. But for the ideal printing we can first go to a stringStream, and buffer the output that way. And then we can print this stream at once to tty.
21-06-2023

ILW = IR test failure due to safepoint while printing, rare, no workaround = MLH = P4
26-04-2023

Most likely related to JDK-8300273 as we are seeing <!-- safepoint while printing --> in the hotspot_pid file.
26-04-2023

Looks like an IR framework issue.
26-04-2023