RFR: 8339741: RISC-V: C ABI breakage for integer on stack [v2]

Fei Yang fyang at openjdk.org
Tue Sep 10 09:16:07 UTC 2024


On Tue, 10 Sep 2024 07:23:53 GMT, Ludovic Henry <luhenry at openjdk.org> wrote:

>> Robbin Ehn has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - Added comment
>>  - Merge branch 'master' into c_abi_error
>>  - Fixed
>
> Marked as reviewed by luhenry (Committer).

> Thanks @luhenry and @RealFYang !
> 
> > (PS: Having said that, a `mv` does seem more obvious. Your call)
> 
> Thinking about it, I see sign/zero extensions bugs still pop-up in major oss, kernel, gcc, etc.., expecting us to have fixed all is a bit naive, and they are pretty easy to introduce. So my suggestion would be to go further; adding MASM methods to check register or an address for proper representation otherwise 'asserting' (in debug builds).
> 
> ~Pseudo code for this case:
> 
> ```
> expect_state_s32(dst.first()->is_stack() ? dst.first()->as_Register() : Address(sp, reg2offset_out(dst.first())))
> ```

Yeah, that makes sense to me especially for sign extension cases. And we already have simple checks for address like in movptr: https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp#L1883.

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

PR Comment: https://git.openjdk.org/jdk/pull/20912#issuecomment-2340109762


More information about the hotspot-dev mailing list