RFR: 8365570: C2 fails assert(false) failed: Unexpected node in SuperWord truncation: CastII [v2]

Jasmine Karthikeyan jkarthikeyan at openjdk.org
Sat Dec 6 20:27:04 UTC 2025


On Fri, 5 Dec 2025 08:23:02 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> After taking a closer look, I think you're correct- I can reproduce the crash using just `@Warmup(0)` and `@Test`. I think I used both while debugging and didn't test whether it worked without `CompLevel.C2`. I've removed it in the latest commit. 
>> However, I noticed that after that I merged from master neither the test nor the reproducer failed compilation before the fix is added. I think another commit must have changed the generated graph so that it no longer tries to vectorize the `CastII`, leading to the crash not being triggered. I looked at the JBS entry and saw that there wasn't another reproducer for this, so I was a bit unsure on what to do. Should this patch be merged with the current test?
>
> @jaskarth Thanks for looking into it!
> 
> I would still add the fix, just in case. And I think the test as well, even if it does not reproduce any more.
> 
> I was wondering: before the merge, when the test still reproduced:
> If you removed the `@Warmup(0)` and `CompLevel.C2`, and instead just do `framework.addFlags` with `-Xcomp`, would that reproduce too? If so, you could have a framework run with and one without Xcomp,  the one with Xcomp also should have a compileonly. What do you think?
> 
> Or we just push the patch as is, to be sure this is done and integrated. What do you think @chhagedorn ?

Yep, I can replicate the crash on the old commit with `TestFramework.runWithFlags("-Xcomp", "-XX:CompileCommand=compileonly,*TestSubwordTruncation::*");` instead of `@Warmup(0)`. I think this would also be a good option, as it would let you get coverage with Xcomp on the other tests as well.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/26827#discussion_r2595422874


More information about the hotspot-compiler-dev mailing list