There are multiple locations in the Hotspot code (only found in C2 so far, so let's start in compiler) with signed overflows which is undefined behavior (compilers could use this undefined behavior for optimizations). We should check our code by configuring with --with-extra-cxx-flags='-ftrapv' and running some extensive testing with it. -ftrapv emits traps for signed additions, subtractions and multiplications. If there is an overflow, we abort.
The affected version is currently set to 21 but should be updated accordingly to the found issues.