RFR(S): 8209639: assert failure in coalesce.cpp: attempted to spill a non-spillable item

Nils Eliasson nils.eliasson at oracle.com
Mon Aug 20 14:22:23 UTC 2018


This is a variant of the bugs 
https://bugs.openjdk.java.net/browse/JDK-8192992 and 
https://bugs.openjdk.java.net/browse/JDK-8206345

An early suggestion was the same fix as you provide. I later tried to 
fix the load scheduling to be less conservative but failed multiple 
times. (It's still overly conservative with respect to phi-nodes, but a 
major rewrite would be necessary.)

The core issue is that the matcher creates a compound testN_mem_reg0 
node, that is forced to be scheduled early by the mem access. This 
forces the test-node far away from the jmp-node. We need to be able to 
detect this already at matching, and match a load + test_reg_reg instead.

One alternative could be to always match a load + testN_reg_reg and try 
to create a peephole rule for testN_mem_reg0 on x64 (the only platform 
with this problem). In this way we would always have a good matching, 
and sometimes get the optimized test in a safe manner.

Regards,

Nils


On 2018-08-17 17:26, Roland Westrelin wrote:
> http://cr.openjdk.java.net/~roland/8209639/webrev.00/
>
> There are 2 loads for the same field in the test() method of the test
> case, one in an exception handler, one in the normal code path. The 2
> loads are commoned and the resulting load is between the call and the
> catch node. The only use for the load is a test against null. The test +
> load is matched as a testN_mem_reg0 and is later cloned by
> PhaseCFG::call_catch_cleanup() and the 2 clones are merged by a Phi
> causing a spill of a flag register.
>
> The straightforward fix I suggest here is to bailout and re-attempt
> compilation with load subsuming disabled.
>
> The test fails with 8 (with a SIGSEGV) 12 and I suppose 11 as well but I
> haven't tried. I'm fine with fixing this for 12 and backporting the fix
> later.
>
> Roland.



More information about the hotspot-compiler-dev mailing list