Withdrawn: 8316234: AArch64: fastdebug build failure with GCC 12 and 13 due to -Wnonnull warning in vm_version_linux_aarch64.cpp

duke duke at openjdk.org
Fri Feb 2 04:30:10 UTC 2024


On Mon, 27 Nov 2023 03:35:31 GMT, Hao Sun <haosun at openjdk.org> wrote:

> I tested {release, fastdebug, slowdebug} JDK builds with GCC 11/12/13 on AArch64, and fastdebug build with GCC 12 and 13 failed due to -Wnonnull warning.
> 
> The warning is raised because GCC 12 and 13 still think that `buf` can be null even if we have the assertion `assert(buf != nullptr, ...);`. Note that GCC 12 and 13 correctly determine the value range of `buflen`, i.e. `1 <= buflen <= 0xffff ffff ffff ffff`.
> 
> Note-1: Since it involves the analysis of `assert` statements, that's why release build can pass.
> 
> Note-2: I suppose that the incorrect optimization result of `nonnull/nullability` for variable `buf` only occurs at high GCC optimization levels. That's why slowdebug build can pass.
> 
> Note-3: To be honest, I didn't fully understand why this warning is raised by GCC 12 and 13. Recently we struggled with GCC 12 false positive warnings many times. See [1][2].
> 
> To suppress this warning, we try to fool GCC compiler via minor code change in this patch.
> 
> [1] https://bugs.openjdk.org/browse/JDK-8299580
> [2] https://bugs.openjdk.org/browse/JDK-8294031

This pull request has been closed without being integrated.

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

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


More information about the hotspot-runtime-dev mailing list