RFR: 8316907: Fix nonnull-compare warnings

Daniel Jeliński djelinski at openjdk.org
Tue Sep 26 16:53:25 UTC 2023


Please review this patch that fixes nonnull-compare warnings emitted by GCC after removing `-fno-delete-null-pointer-checks`.

The changes are pretty straightforward:
- removal of `assert(this)` only changes the behavior of debug code; assertion failure in that place would result in a crash later on,
- the check in `CodeBuffer::print` is a bit more complex to review; fortunately all uses except [`print_buf_locs`](https://github.com/openjdk/jdk/blob/1f7dfda7059f9dc14bff61b3c77d769ade85557d/src/hotspot/share/code/relocInfo.cpp#L990) are in CodeBuffer, and `print_buf_locs` is only used by developers from debugger.

I verified tier1-5 tests, just in case. No new failures.

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

Commit messages:
 - Fix nonnull warnings

Changes: https://git.openjdk.org/jdk/pull/15927/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15927&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8316907
  Stats: 6 lines in 2 files changed: 0 ins; 6 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/15927.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15927/head:pull/15927

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


More information about the hotspot-compiler-dev mailing list