RFR: 8340620: Fix -Wzero-as-null-pointer-constant warnings for CompressedOops [v2]

Kim Barrett kbarrett at openjdk.org
Fri Sep 27 09:03:15 UTC 2024


> Please review this change that fixes -Wzero-as-null-pointer-constant warnings
> in CompressedOops code.  These all relate to CompressedOops::base().
> 
> I also added a couple of asserts to verify our assumptions about null pointer
> constants being representationally zero. That isn't a Standard-conforming
> assumption, but holds for all platforms we currently support. I considered,
> and even explored, a couple of different options.
> 
> (1) Continue to have CompressedOops::base() be a pointer, but avoid that
> assumption, being more careful about how zero-valued pointers are treated. But
> that adds significant complexity that we can't test, since we don't support
> any platforms needing that extra work.
> 
> (2) Change CompressedOops::base() to an integral adjustment.  This is probably
> the correct approach, but is much more intrusive and wide ranging in the
> changes required.  Maybe something for the future.
> 
> Testing: mach5 tier1-5
> GHA testing, verifying builds on some platforms not supported by Oracle.
> 
> There are some simple changes to s390 and ppc code that I haven't tested,
> beyond verifying compilation.

Kim Barrett has updated the pull request incrementally with one additional commit since the last revision:

  remove nullptr representation asserts

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/21172/files
  - new: https://git.openjdk.org/jdk/pull/21172/files/ef0dc56e..a99a6cd9

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=21172&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21172&range=00-01

  Stats: 6 lines in 1 file changed: 0 ins; 6 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/21172.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21172/head:pull/21172

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


More information about the hotspot-dev mailing list