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. I agree with Dean. I think it's the same problem I described in [JDK-8353851](https://bugs.openjdk.org/browse/JDK-8353851). ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/2579#discussion_r3481919004
