Integrated: 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:45 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.

This pull request has now been integrated.

Changeset: 2286fae3
Author:    Kim Barrett <kbarrett at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/2286fae300b37f4b69ed817d3edea6fe7fa2f52d
Stats:     1 line in 1 file changed: 0 ins; 0 del; 1 mod

8345159: RISCV: Fix -Wzero-as-null-pointer-constant warning in emit_static_call_stub

Reviewed-by: mli, rehn

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

PR: https://git.openjdk.org/jdk/pull/22435


More information about the hotspot-compiler-dev mailing list