RFR: 8312440: assert(cast != nullptr) failed: must have added a cast to pin the node

Roland Westrelin roland at openjdk.org
Mon Jul 24 14:33:51 UTC 2023


The test has a loop nest with 2 loops. A node is sunk out of the inner
loop. A cast is created to pin the node out of loop. The logic added
by 8308103 looks for an existing cast with the same inputs. It finds
one and uses that one. That existing cast was created before the
current round of loop opts. Eventhough it has the right out of inner
loop (but in outer loop) control input, it was assigned a control out
of both loops (the control is legal, it just happens that no use keeps
the cast in the outer loop). Next, the same node is sunk out of the
outer loop. The logic for sinking nodes looks for an input in the
outer loop (otherwise why would the node be in the outer loop) and
find none even though there should be one. The assert fires. The
reason is that the cast input has control out of loop. The fix I
propose is to not use an existing cast if it doesn't have the expected
control.

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

Commit messages:
 - fix & test

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

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


More information about the hotspot-compiler-dev mailing list