[jdk17] RFR: 8268366 Incorrect calculation of has_fpu_registers in C1 linear scan

Christian Hagedorn chagedorn at openjdk.java.net
Fri Jun 11 11:42:51 UTC 2021


On Thu, 10 Jun 2021 23:43:43 GMT, Dean Long <dlong at openjdk.org> wrote:

> If there is a mismatch between bytecode use of floating point and generated IR, has_fpu_registers can get an incorrect value and result in a crash or assert.  This PR adds a missing case for the computation of has_fpu_registers, restores an assert that was removed, adds a bailout for non-debug builds, and adds a test.

Otherwise, the fix looks good.

src/hotspot/share/c1/c1_LinearScan.cpp line 1661:

> 1659: 
> 1660:   Interval* precolored_cpu_intervals = Interval::end(), *not_precolored_cpu_intervals = Interval::end();
> 1661:   Interval* precolored_fpu_intervals = Interval::end(), *not_precolored_fpu_intervals = Interval::end();

Initialization is not necessary as it is already done in `create_unhandled_lists`:
https://github.com/openjdk/jdk17/blob/853d9428e26ba6a6ac703c2b9427f6c6f1bae182/src/hotspot/share/c1/c1_LinearScan.cpp#L1531-L1534

src/hotspot/share/c1/c1_LinearScan.cpp line 1690:

> 1688:       BAILOUT("missed an uncolored fpu interval");
> 1689:     }
> 1690: #endif

I suggest to already do these checks right after `create_unhandled_lists` which sets `not_precolored_fpu_intervals`.

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

PR: https://git.openjdk.java.net/jdk17/pull/10


More information about the hotspot-compiler-dev mailing list