RFR: 8374436: compiler/igvn/IntegerDivValueTests.java failed with division by zero

Emanuel Peter epeter at openjdk.org
Tue Jan 6 15:37:20 UTC 2026


On Mon, 5 Jan 2026 18:37:54 GMT, Tobias Hotz <duke at openjdk.org> wrote:

> 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

test/hotspot/jtreg/compiler/igvn/IntegerDivValueTests.java line 207:

> 205:     @Run(test = {"testIntConstantFolding", "testIntConstantFoldingSpecialCase"})
> 206:     public void checkIntConstants(RunInfo info) {
> 207:         if (INT_CONST_2 == 0) {

Since you are working on this: Could `testIntRandomLimits` not also have a division by zero exception?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29045#discussion_r2665332193


More information about the hotspot-compiler-dev mailing list