RFR: 8346836: C2: Introduce a way to verify the correctness of ConstraintCastNodes at runtime
Emanuel Peter
epeter at openjdk.org
Fri Jan 17 07:51:34 UTC 2025
On Wed, 25 Dec 2024 14:54:02 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
> Hi,
>
> This patch adds a develop flag `VerifyConstraintCasts`, which will verify the correctness of `CastIINode`s and `CastLLNode`s at runtime and crash the VM if the dynamic value lies outside the type value range.
>
> Please take a look, thanks a lot.
Talked with @TobiHartmann , he thinks it is ok to integrate the flags, even if it has failures. Let's go ahead with it then.
It would still be nice to have 2 modes: one where we do the widening, and one without. Both may catch different things, right? I imagine it like this: `VerifyConstraintCasts=1` -> do widening. `VerifyConstraintCasts=2` -> disable widening.
Plus, can you do this?
> And: you should have at least one plain test where you enable the flag, and it compiles everything required to run an empty main function.
Or does that already trigger failures? It would be nice just so we have some basic testing, and see that the flag is not completely broken.
What about implementing the same for aarch64? That would increase our coverage eventually.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22880#issuecomment-2597626211
PR Comment: https://git.openjdk.org/jdk/pull/22880#issuecomment-2597627288
More information about the hotspot-compiler-dev
mailing list