RFR: 8307131: C2: assert(false) failed: malformed control flow

Roland Westrelin roland at openjdk.org
Fri May 5 08:57:25 UTC 2023


The IR graph has a loop nest with 2 loops and 2 safepoints. Both
safepoints are in the inner loop. One is on the backedge of the inner
loop. The inner loop is transformed into a counted loop and that
safepoint is removed. The other safepoint is right above the inner
loop's exit condition. The outer strip mined loop is constructed and
the safepoint is moved to the outer strip mined loop eventhough that
safepoint is marked as non deleteable. The inner loop is later on
removed, the outer strip mined loop is too, so is the safepoint. What
was the outer loop of the 2 loop nest becomes an infinite loop without
a safepoint and is considered dead code which in turn causes the
assert to fire.

The fix I propose is to only build the strip mined loop if the
safepoint that's moved to the outer strip mined loop is deleteable.

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

Commit messages:
 - fix & test

Changes: https://git.openjdk.org/jdk/pull/13826/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13826&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8307131
  Stats: 58 lines in 2 files changed: 57 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/13826.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13826/head:pull/13826

PR: https://git.openjdk.org/jdk/pull/13826


More information about the hotspot-compiler-dev mailing list