RFR: 8369912: [TESTBUG] testlibrary_tests/template_framework/examples/TestExpressions.java fails with ArithmeticException: / by zero - forgot to respect Expression.info

Manuel Hässig mhaessig at openjdk.org
Thu Oct 16 07:01:43 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`.

Thank you for fixing this, @eme64. Looks good to me.

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

Marked as reviewed by mhaessig (Committer).

PR Review: https://git.openjdk.org/jdk/pull/27824#pullrequestreview-3343323595


More information about the hotspot-compiler-dev mailing list