RFR: 8345159: RISCV: Fix -Wzero-as-null-pointer-constant warning in emit_static_call_stub
Kim Barrett
kbarrett at openjdk.org
Fri Dec 6 06:34:44 UTC 2024
On Thu, 28 Nov 2024 12:05:28 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> Please review this change to RISCV code to remove a
> -Wzero-as-null-pointer-constant warning in MacroAssembler::emit_static_call_stub.
>
> It was calling MacroAssembler::movptr with the second (address) argument being
> a literal 0. Rather than changing it to use nullptr for that argument, I've
> instead changed it to call the movptr2 helper function, which takes the target
> address as a unint64_t. This eliminates the conversion of 0 to a pointer and
> then back to an integer 0. It seemed to me more natural to use that helper
> directly, as it was presumed that was what ended up being called anyway. But
> the riscv porters should weigh in on whether that's a good approach to dealing
> with this case.
>
> Testing: GHA sanity tests, which includes building for linux-riscv64. I don't
> have the capability to run tests for this platform, so hoping someone from the
> riscv porters can do more testing.
Thanks for reviews and discussion.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22435#issuecomment-2522245304
More information about the hotspot-compiler-dev
mailing list