RFR: 8335662: [AArch64] C1: guarantee(val < (1ULL << nbits)) failed: Field too big for insn [v2]
Andrew Haley
aph at openjdk.org
Tue Oct 15 19:35:18 UTC 2024
On Tue, 15 Oct 2024 18:53:45 GMT, Chad Rakoczy <duke at openjdk.org> wrote:
>> [JDK-8335662](https://bugs.openjdk.org/browse/JDK-8335662)
>>
>> Crash occurs in C1 during OSR when copying locks from interpreter frame to compiled frame. All loads used immediate offset regardless of offset size causing crash when it is over the max size for the instruction (32760). Fix is to check the size before preforming the load and storing the offset in a register if needed.
>>
>> I believe the risk is low because there will be no change to the instruction if the immediate offset fits in the load instruction. The instruction is only updated when the `offset_ok_for_immed` check fails which would cause the crash anyways
>>
>> Confirmed that added test fails before patch and passes after
>
> Chad Rakoczy has updated the pull request incrementally with two additional commits since the last revision:
>
> - Add blank line at end of test
> - Add jasm and update test description
One thing for you to think about ifm you are interested in sone further work in this area..
This is a generic problem. It might be very beneficial to look for every base + immediate offset instruction, see if there is a possibility that there may be an overflow, and insert a `form_address()`.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/21473#issuecomment-2414846924
More information about the hotspot-compiler-dev
mailing list