JDK-8350329 : C2: Div looses dependency on condition that guarantees divisor not zero in counted loop after peeling
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 22,24,25
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-02-19
  • Updated: 2025-05-22
  • Resolved: 2025-05-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25
25 b24Fixed
Related Reports
Relates :  
Relates :  
Description
$ java -XX:-TieredCompilation -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-UseLoopPredicate -XX:-UseProfiledLoopPredicate -XX:+StressGCM TestPeeledLoopNoBackedgeFloatingDiv

...

# 

A fatal error has been detected by the Java Runtime Environment:
#
 SIGFPE (0x8) at pc=0x00007f6df8342577, pid=3622847, tid=3622848
#
JRE version: OpenJDK Runtime Environment (25.0) (fastdebug build 25-internal-adhoc.roland.jdk-jdk)
Java VM: OpenJDK 64-Bit Server VM (fastdebug 25-internal-adhoc.roland.jdk-jdk, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
Problematic frame:
J 5 c2 TestPeeledLoopNoBackedgeFloatingDiv.test1(IIZZ)I (41 bytes) @ 0x00007f6df8342577 [0x00007f6df8342520+0x0000000000000057]
Comments
Changeset: 26cb016b Branch: master Author: Roland Westrelin <roland@openjdk.org> Date: 2025-05-19 11:06:03 +0000 URL: https://git.openjdk.org/jdk/commit/26cb016b750963a4622985399130024792691984
19-05-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/25262 Date: 2025-05-16 08:28:20 +0000
16-05-2025

Since this is an old issue and we are getting closer to RDP 1 for JDK 25 (June 05, 2025), I'm tentatively deferring this to JDK 26. [~roland] feel free to still fix this in JDK 25 if there's time left.
13-05-2025

ILW = SIGFPE due to division by zero, single test, disable compilation of affected method = HLM = P3
20-02-2025

Start to fail after JDK-8312547 but that's probably just a side effect.
20-02-2025