RFR: 8356647: C2: Excessively strict assert in PhaseIdealLoop::do_unroll
Marc Chevalier
mchevalier at openjdk.org
Wed May 21 21:05:52 UTC 2025
On Mon, 19 May 2025 06:43:38 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:
> This assert seems a bit too tight. See the JBS issue to check the math: the bound of `trip_count` should be `<= 2^31`, while the current bound is ` < (julong)max_juint/2` = floor((2^32-1)/2) = (2^32-2) / 2 = 2^31-1.
Nope, I couldn't find anything like that before, and I didn't manage to trick the stressed case to reproduce without the stress flag. But I'm not sure what that implies: if unroll happens in such a case, we would hit the assert, which manual computation shows as too restrictive (that is not true in the general case). That means that if we change policy_peeling in some ways, we could hit the assert in do_unroll. I don't really see how the fact we use a stress flag to reproduce changes anything: we do fix bugs that manifest only with some stress flags because we are always one irrelevant change away from having it happen for real.
But if you think it's not worth fixing as long as we can't find a case that makes it happen without stress flag, fine with me! I don't mind closing the issue either.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25295#issuecomment-2899225819
More information about the hotspot-compiler-dev
mailing list