RFR: 8282231: x86-32: runtime call to SharedRuntime::ldiv corrupts registers [v2]

Jie Fu jiefu at openjdk.java.net
Tue Feb 22 14:52:49 UTC 2022


On Tue, 22 Feb 2022 14:30:24 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> In x86_32.ad, a call to SharedRuntime::ldiv doesn't save all of the call-clobbered registers. Also SharedRuntime::lrem. 
>> effect(CALL) is the simplest way to fix this, and AFAIK the most efficient too.
>> 
>> This is by no means the only bug in this area, but it's trivial to fix and allows a bootcycle build to complete on recent Linuxes.
>
> Andrew Haley has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Whitespace

So how did you find this bug?
Is it possible to add a jtreg test for this fix?

Please also update the copyright year.
Thanks.

src/hotspot/cpu/x86/x86_32.ad line 7828:

> 7826: 
> 7827: // Divide Register Long
> 7828: instruct divL_eReg( eADXRegL dst, eRegL src1, eRegL src2, eFlagsReg cr, eCXRegI cx, eBXRegI bx ) %{

I agree with @shipilev that we can remove `eFlagsReg cr, eCXRegI cx, eBXRegI bx` here, right?

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

PR: https://git.openjdk.java.net/jdk/pull/7575


More information about the hotspot-compiler-dev mailing list