[lworld] RFR: 8265726: [lworld] C2 compilation fails with assert "uses must be dominated by definitions"

Tobias Hartmann thartmann at openjdk.java.net
Fri Apr 23 11:38:07 UTC 2021


We hit an assert during `PhaseCFG` because the Phi input to a CatchNode does not dominate. The problem is in `PhaseMacroExpand::expand_mh_intrinsic_return` where we rewire projection nodes to merge the state of the slow call in. 

Here's the `invokeBasic` call before macro expansion:
![BeforeMacroExpand](https://user-images.githubusercontent.com/5312595/115862604-9b8e9700-a434-11eb-862f-eee42bcf0504.png)
And after macro expansion:
![AfterMacroExpand](https://user-images.githubusercontent.com/5312595/115862618-a1847800-a434-11eb-8bd1-fa01d5f518fc.png)
The input of the CatchNode was accidentally replaced by the Phi merging the exception IO from both calls.

The fix is to re-connect the CatchNode.

Thanks,
Tobias

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

Commit messages:
 - 8265726: [lworld] C2 compilation fails with assert 'uses must be dominated by definitions'

Changes: https://git.openjdk.java.net/valhalla/pull/391/files
 Webrev: https://webrevs.openjdk.java.net/?repo=valhalla&pr=391&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8265726
  Stats: 6 lines in 2 files changed: 3 ins; 3 del; 0 mod
  Patch: https://git.openjdk.java.net/valhalla/pull/391.diff
  Fetch: git fetch https://git.openjdk.java.net/valhalla pull/391/head:pull/391

PR: https://git.openjdk.java.net/valhalla/pull/391


More information about the valhalla-dev mailing list