The problem is that we are pushing casts through InlineTypeNodes without checking if their types are even compatible. In dead parts of the graph, when a type check wasn't folded yet, the type of the CheckCastPP can be completely unrelated to the type of the InlineTypeNode. Pushing the cast through leads to an incorrect type being used further below in the graph and subsequent failures.
I tried hard to come up with standalone reproducer for this but failed. It reproduces reliably with replay compilation though. Thanks, Tobias --------- - [x] I confirm that I make this contribution in accordance with the [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). ------------- Commit messages: - JDK-8384359 Changes: https://git.openjdk.org/valhalla/pull/2423/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=2423&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8384359 Stats: 4 lines in 2 files changed: 2 ins; 0 del; 2 mod Patch: https://git.openjdk.org/valhalla/pull/2423.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2423/head:pull/2423 PR: https://git.openjdk.org/valhalla/pull/2423
