RFR: 8299580: RISC-V: fail to build with GCC 12 due to stringop-overflow warning

Feilong Jiang fjiang at openjdk.org
Fri Jan 6 03:35:48 UTC 2023


On Thu, 5 Jan 2023 04:18:50 GMT, Fei Yang <fyang at openjdk.org> wrote:

> Release fail to build with GCC-12 due to warnings been treated as errors. But the mentioned HotSpot code looks fine, so this looks to me like a GCC-12 suprious warning. This issue does not menifest on other platforms because they are using inline assembly code instead of calling GCC builtins like __atomic_add_fetch to implement class atomic.
> 
> Currently, class atomic is only partially implemented with inline assembly code on RISC-V. Instead of disabling the stringop-overflow warning when building HotSpot, I would prefer reimplementing other functions of class atomic using inline assembly code. That way has the extra benefit of providing us fine-grained control on code generation for these atomics. This is the first version which maps to the original implementation with GCC builtins. I will further improve this part distinguishing different memory ordering requirements.
> 
> Testing:
> - [x] release and fastdebug build fine with both GCC-11 and GCC-12.
> - [x] run tier1-3 tests on HiFive Unmatched.
> - [x] run non-trivial benchmark workloads like: renaissance, specjvm2008, specjbb2015, etc.

Looks good.

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

Marked as reviewed by fjiang (Author).

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


More information about the hotspot-runtime-dev mailing list