RFR: 8345159: RISCV: Fix -Wzero-as-null-pointer-constant warning in emit_static_call_stub
Kim Barrett
kbarrett at openjdk.org
Thu Nov 28 12:10:45 UTC 2024
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.
-------------
Commit messages:
- fix riscv
Changes: https://git.openjdk.org/jdk/pull/22435/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22435&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8345159
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/22435.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/22435/head:pull/22435
PR: https://git.openjdk.org/jdk/pull/22435
More information about the hotspot-compiler-dev
mailing list