JDK-8304328 : C2 Bailout "failed spill-split-recycle sanity check" reveals hidden issue with RA
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2023-03-16
  • Updated: 2023-03-16
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
Relates :  
Relates :  
Description
In src/hotspot/share/opto/chaitin.cpp PhaseChaitin::Register_Allocate
we have the following bailout.

C->record_method_not_compilable("failed spill-split-recycle sanity check");

In my testing for JDK-8303951, I added an assert, and it did not fail anywhere but in the test
test/hotspot/jtreg/compiler/regalloc/TestC2IntPressure.java

This test was added in JDK-8268858 by [~jzhu].

But that test is supposed to check that such a bailout does not happen, or at least it checks that we compile some method that used to lead to the bailout.

Please investigate why this bailout is there, and why we hit it.
Please add an assert before the bailout, if that is possible. I wanted to add it for JDK-8303951, but because of this issue here, I cannot yet do it.

I reproduced it like this: add assert before bailout. Then I ran:

~/Documents/jtreg/bin/jtreg -va -s -jdk:/home/emanuel/Documents/fork3-jdk/build/linux-x64-slowdebug/jdk -javaoptions:"-server -Xcomp" -J-Djavatest.maxOutputSize=1000000 /home/emanuel/Documents/fork3-jdk/open/test/hotspot/jtreg/compiler/regalloc/TestC2IntPressure.java

[~jzhu] ran it without the assert, and saw that there were multiple methods with this bailout.

Update:
I also got the assert hit with this test:
jdk/internal/vm/Continuation/Fuzz.java#preserve-fp
And extra flags: -Xcomp -XX:+CreateCoredumpOnCrash -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:+TieredCompilation
Comments
ILW = Bailout during C2 compilation, rare, no workaround = MLH = P4
16-03-2023

[~jzhu] Can I assign you this Bug?
16-03-2023