RFR: 8374436: compiler/igvn/IntegerDivValueTests.java failed with division by zero
Tobias Hotz
duke at openjdk.org
Mon Jan 5 18:45:42 UTC 2026
This PR is a follow-up to https://github.com/openjdk/jdk/pull/26143
I've missed that INT_CONST_2 and LONG_CONST_2 may be zero depending on the seed, which causes arithmetic exceptions that are not being caught.
The fix is simple: Detect if these constants are zero, and if so, expect a div by zero exception to be thrown.
I've not added additional test as this is a testbug, but I verified this test works correctly now if INT_CONST_2 is zero
-------------
Commit messages:
- Fix div by zero due to const 2 being zero cauing failing tests
Changes: https://git.openjdk.org/jdk/pull/29045/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29045&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8374436
Stats: 10 lines in 1 file changed: 8 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/29045.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/29045/head:pull/29045
PR: https://git.openjdk.org/jdk/pull/29045
More information about the hotspot-compiler-dev
mailing list