RFR: 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:02 UTC 2025
On Thu, 16 Oct 2025 06:58:40 GMT, Manuel Hässig <mhaessig 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.
@mhaessig @vnkozlov Thanks for the reviews!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27824#issuecomment-3411082237
More information about the hotspot-compiler-dev
mailing list