On Fri, 26 Jun 2026 06:28:11 GMT, Dean Long <[email protected]> wrote:
>> src/hotspot/share/c1/c1_LIRGenerator.cpp line 2397: >> >>> 2395: // (inside the conditional code), and the stub's continuation >>> jump >>> 2396: // would skip that spill, leaving the spill slot stale. >>> 2397: load_result = new_register(T_OBJECT); >> >> Shouldn't the `rlock_result` just above in line 2381 do exactly that? > > I think we need to detect spills in conditional code at compile time. > > I'm not convinced creating a new virtual register for "load_result" here is > correct either. It moves the problem to a different virtual register, one > that has a shorter lifetime that "result", but does that guarantee there > won't be a spill? We are still setting a register in two different paths > that are invisible to C1 LIR. @dean-long @TobiHartmann Hi, I'm so sorry for being late. I think this is the same issue as [JDK-8353851](https://bugs.openjdk.org/browse/JDK-8353851). > Maybe setting `LIRGenerator::set_in_conditional_code` here like we do as > mitigation in Load/StoreIndexed would help? I will try this fix. ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/2579#discussion_r3486245927
