RFR: 8290451: Incorrect result when switching to C2 OSR compilation from C1
Roland Westrelin
roland at openjdk.org
Fri Aug 19 08:24:55 UTC 2022
In BadStateAtLongCmp.test(), the field increment is between the lcmp
and iflt bytecodes that implement the loop exit condition (handcrafted
bytecodes required as such a sequence is not generated by javac). When
compiled by C1, lcmp+iflt is canonicalized to a single If and it
captures the state of the lcmp bytecode. Tiered compilation attaches
the state to a deoptimization call to switch to an OSR
compilation. That state causes the field increment to be reexecuted
when the switch to a C2 method occurs at the backbranch. Proposed fix
is to use the state at the iflt instead.
-------------
Commit messages:
- comment
- fix
- test
Changes: https://git.openjdk.org/jdk/pull/9938/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9938&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8290451
Stats: 113 lines in 3 files changed: 112 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/9938.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/9938/head:pull/9938
PR: https://git.openjdk.org/jdk/pull/9938
More information about the hotspot-compiler-dev
mailing list