RFR: 8290451: Incorrect result when switching to C2 OSR compilation from C1

Tobias Hartmann thartmann at openjdk.org
Mon Aug 29 07:47:13 UTC 2022


On Fri, 19 Aug 2022 08:16:42 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> 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.

Looks good to me.

test/hotspot/jtreg/compiler/c1/BadStateAtLongCmp.jasm line 25:

> 23: 
> 24: super public class BadStateAtLongCmp
> 25: 	version 61:0

Please use an older bytecode version to simplify backports.

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

Marked as reviewed by thartmann (Reviewer).

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


More information about the hotspot-compiler-dev mailing list