Integrated: 8369912: [TESTBUG] testlibrary_tests/template_framework/examples/TestExpressions.java fails with ArithmeticException: / by zero - forgot to respect Expression.info
Emanuel Peter
epeter at openjdk.org
Thu Oct 16 14:13:03 UTC 2025
On Wed, 15 Oct 2025 14:34:52 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
> The test generates a test for each operator, like this:
>
> public static int primitiveConTest_185_compiled() {
> return (989451435 % 0);
> }
>
> However, some operators throw exceptions, just like here the `%`, when given a zero rhs argument. The expression already knows about that, we just need to generate try-catch statements in the code.
>
> Similarly, some operators do not always return deterministic results (different Nan, or precision). So we need to handle that too.
>
> Note: we already do all of that in the `test/hotspot/jtreg/compiler/igvn/ExpressionFuzzer.java`.
This pull request has now been integrated.
Changeset: 5dfe115c
Author: Emanuel Peter <epeter at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/5dfe115ce1fbcff67777518a3c23a7560ebec423
Stats: 30 lines in 1 file changed: 23 ins; 0 del; 7 mod
8369912: [TESTBUG] testlibrary_tests/template_framework/examples/TestExpressions.java fails with ArithmeticException: / by zero - forgot to respect Expression.info
Reviewed-by: kvn, mhaessig
-------------
PR: https://git.openjdk.org/jdk/pull/27824
More information about the hotspot-compiler-dev
mailing list