RFR: 8270886: Crash in PhaseIdealLoop::verify_strip_mined_scheduling

Roland Westrelin roland at openjdk.java.net
Tue Jul 27 14:55:48 UTC 2021


The crash occurs because an OuterStripMinedLoopEnd has only a single
projection. The root cause is that an IfNode has a single
projection. When the condition of that If constant folds, the IfNode
ends up with no use which causes it to be removed. The
OuterStripMinedLoopEnd projection is removed as a consequence.

When the If is constructed, it does have 2 projections. One of the
projections lead to an infinite loop. That infinite loop has a
safepoint node that's input to the Root node. When
remove_root_to_sfpts_edges() executes in Compile::Optimize(), that
edge is removed. But because PhaseRenumberLive runs next (a subclass
of PhaseRemoveUseless), the infinite loop is removed.

The fix is to simply move the call to remove_root_to_sfpts_edges()
after PhaseRemoveUseless.

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

Commit messages:
 - whitespaces
 - fix & test

Changes: https://git.openjdk.java.net/jdk/pull/4911/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4911&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8270886
  Stats: 176 lines in 2 files changed: 171 ins; 4 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4911.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4911/head:pull/4911

PR: https://git.openjdk.java.net/jdk/pull/4911


More information about the hotspot-compiler-dev mailing list