RFR: 8320212: Disable GCC stringop-overflow warning for affected files

Magnus Ihse Bursie ihse at openjdk.org
Fri Nov 17 15:39:30 UTC 2023


On Fri, 17 Nov 2023 00:31:36 GMT, Mikael Vidstedt <mikael at openjdk.org> wrote:

> In JDK-8319818 the stringop-overflow warnings were disabled for linux-aarch64 (fastdebug). With the changes in JDK-8319883 additional stringop-overflow warnings are produced with GCC 13.2.0, this time for linux-x64-zero (fastdebug). The warnings are related to GCC thinking JavaThread:current (and Thread::current) may return nullptr where in fact they can't. I tried several ways to convince GCC about this fact but in the end failed.
> 
> This change disables the warning for the affected files (only). I'm not in love with that solution but I've run out of ideas at this point. An alternative would be to disable the warning globally, which has its own set of pros and cons.

Looks okay from a build perspective. In the end, I guess some hotspot developers need to weigh in if this is acceptable.

I presume you have tried to analyze what makes the Thread:current access different in these files, so that gcc only complains at these instances?

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

Marked as reviewed by ihse (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/16702#pullrequestreview-1737300910


More information about the build-dev mailing list