RFR: 8286562: GCC 12 reports some compiler warnings [v5]

Kim Barrett kbarrett at openjdk.java.net
Sun May 22 16:48:42 UTC 2022


On Sun, 22 May 2022 08:45:48 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:

>> I don't think this warning has anything to do with that NULL check. But I'm
>> still not understanding what it is warning about. The "region of size 0" part
>> of the warning message seems important, but I'm not (yet?) seeing how it could
>> be coming up with that.  The code involved here is pretty contorted...
>
> It might be GCC bug...
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578
> 
> This issue is for integer literal, but [Comment 29](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c29) mentions address calculation (e.g. `NULL + offset`) - it is similar the problem in jfrTraceIdBits.inline.hp because `dest` comes from `low_addr()` (`addr + low_offset`).

I don't see the similarity.  That gcc bug is about literals used as addresses,
which get treated (suggested inappropriately) as NULL+offset, with NULL+offset
being a cause of warnings.  I don't see that happening in our case.  That is,
in our `addr + low_offset`, `addr` doesn't seem to be either a literal or NULL
that I can see.

It's hard for me to investigate this any further just by perusing the code, so
I'm in the process of getting set up to build with gcc12.x.  That will let me
do some experiments. It may take me a few days to get to that point though.

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

PR: https://git.openjdk.java.net/jdk/pull/8646



More information about the client-libs-dev mailing list