RFR: 8315794: RISC-V: build fails with GCC 12.3

Antonios Printezis tonyp at openjdk.org
Fri Sep 15 17:32:43 UTC 2023


On Thu, 14 Sep 2023 08:00:26 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

> When we saw this warning in other places it was because we were
> passing a pointer that was known to be null on some (not supposed to
> be reachable) code paths. I don't see how that can be what's going on
> here though.

Yeah, I've been perplexed too.

> There's an Atomic::sub on the same data member a few lines later. Does that get warned about? And why these?

Very interesting. If I comment out the calls to `Atomic::add()` that trigger the compilation failure (in `xPageAllocator.cpp` and `zPageAllocator.cpp`), the build succeeds. If I replace them with `Atomic::sub()`, I get the same failure. Interesting that the compiler doesn't complain about the call to `Atomic::sub()` a bit further down (with the same args!), as you pointed out.

> Disabling the warning for this file feels a bit too much like voodoo,
> though might be all we've got right now.

I'll spend a bit more time to see if there's a better way to fix this. But, is there a way to disable the warning only for RISC-V builds, instead of all builds?

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

PR Comment: https://git.openjdk.org/jdk/pull/15593#issuecomment-1721617465


More information about the build-dev mailing list