JDK-8306997 : C2: "malformed control flow" assert due to missing safepoint on backedge with a switch
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17,20,21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-04-27
  • Updated: 2025-05-22
  • Resolved: 2023-05-03
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 17 JDK 21
17.0.16Fixed 21 b21Fixed
Related Reports
Relates :  
Description
I hit:

#  Internal Error (/home/roland/jdk-jdk/src/hotspot/share/opto/compile.cpp:4003), pid=2305479, tid=2305494
#  assert(false) failed: malformed control flow

I'll provide a test case in the PR.
Comments
[jdk17u-fix-request] Approval Request from Satyen Subramaniam for backport. Two line change to add missing safepoint on backedge with a switch. Adds a test. Risk: Low. Tip change was merged in May 2023 and PR adds a test to confirm functionality. Touches hotspot code, Testing: * GHA Sanity Checks * Tier 1 and 2 tests locally * test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnSwitch.java
19-05-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk17u-dev/pull/3589 Date: 2025-05-19 20:50:06 +0000
19-05-2025

Changeset: e0774bed Author: Roland Westrelin <roland@openjdk.org> Date: 2023-05-03 08:29:01 +0000 URL: https://git.openjdk.org/jdk/commit/e0774bed2d2fcd850f5ca6884dd7aeb45f0bdaef
03-05-2023

ILW = Debug assert in C2 due to broken control flow (bailout in product), single test case, disable compilation of affected method = MLM = P4
28-04-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13688 Date: 2023-04-27 11:27:30 +0000
27-04-2023