[jdk8u-dev] RFR: 8329826: GCC 12 reports some compiler error when building jdk8

Simon Tooke stooke at redhat.com
Tue May 7 17:06:03 UTC 2024


On 4/15/24 9:38 PM, Kun Wang wrote:
> On Tue, 9 Apr 2024 09:30:05 GMT, Kun Wang <kwang at openjdk.org> wrote:
>
>> Env:
>> ldd (GNU libc) 2.38
>> gcc (GCC) 12.3.1
>>
>> Test the PR patch;
>> Build release/fastdebug/slowdebug version pass
>>
>> Reported issue : https://bugs.openjdk.org/browse/JDK-8329826
>> The `register` issue is already being handled by the work ongoing in #357
>>
>> I have not seen other failures. Are they specific to certain architectures?

The issue in  hotspot/src/share/vm/opto/type.cpp:2556 (potential NULL 
pointer) is common to all architectures.

I have see some other issues for GCC 14 (and the latest clang/Xcode), 
which I will bring up in a separate PR.


>>
>> We should not be introducing changes uniquely to 8u unless it is really necessary, so we need to look at this code in later JDKs.
> Thank you very much for your code review and also suggest.
> I found this problem when using gcc12 under the aarch64 architecture. After referring to https://github.com/openjdk/jdk8u-dev/pull/357, I still encounter other problems. I may need to remove the changes in adlc.make, the others are still having build issues in gcc12.
>
> In file included from /home//jdk8u-dev-master/hotspot/src/share/vm/runtime/orderAccess.inline.hpp:45,
>                   from /home//jdk8u-dev-master/hotspot/src/os/linux/vm/os_linux.inline.hpp:29,
>                   from /home//jdk8u-dev-master/hotspot/src/share/vm/utilities/histogram.hpp:32,
>                   from /home//jdk8u-dev-master/hotspot/src/share/vm/runtime/mutex.hpp:30,
>                   from /home//jdk8u-dev-master/hotspot/src/share/vm/classfile/classLoaderData.hpp:32,
>                   from /home//jdk8u-dev-master/hotspot/src/share/vm/oops/typeArrayKlass.hpp:28,
>                   from /home//jdk8u-dev-master/hotspot/src/share/vm/oops/typeArrayOop.hpp:29,
>                   from /home//jdk8u-dev-master/hotspot/src/share/vm/oops/constantPool.hpp:32,
>                   from /home//jdk8u-dev-master/hotspot/src/share/vm/oops/method.hpp:33,
>                   from /home//jdk8u-dev-master/hotspot/src/share/vm/runtime/frame.hpp:28,
>                   from /home//jdk8u-dev-master/hotspot/src/share/vm/code/codeBlob.hpp:30,
>                   from /home//jdk8u-dev-master/hotspot/src/share/vm/code/codeCache.hpp:28,
>                   from /home//jdk8u-dev-master/hotspot/src/cpu/aarch64/vm/assembler_aarch64.inline.hpp:32,
>                   from /home//jdk8u-dev-master/hotspot/src/share/vm/asm/assembler.inline.hpp:46,
>                   from /home//jdk8u-dev-master/hotspot/src/share/vm/precompiled/precompiled.hpp:30:
> In static member function ‘static void* OrderAccess::load_ptr_acquire(const volatile void*)’,
>      inlined from ‘nmethod* volatile Method::code() const’ at /home//jdk8u-dev-master/hotspot/src/share/vm/oops/method.hpp:454:127,
>      inlined from ‘static bool CompileBroker::compilation_is_complete(methodHandle, int, int)’ at /home//jdk8u-dev-master/hotspot/src/share/vm/compiler/compileBroker.cpp:1463:37,
>      inlined from ‘static bool CompileBroker::compilation_is_complete(methodHandle, int, int)’ at /home//jdk8u-dev-master/hotspot/src/share/vm/compiler/compileBroker.cpp:1448:6,
>      inlined from ‘static nmethod* CompileBroker::compile_method(methodHandle, int, int, methodHandle, int, const char*, Thread*)’ at /home//jdk8u-dev-master/hotspot/src/share/vm/compiler/compileBroker.cpp:1357:34:
> /home//jdk8u-dev-master/hotspot/src/os_cpu/linux_aarch64/vm/orderAccess_linux_aarch64.inline.hpp:78:28: error: ‘long unsigned int __atomic_load_8(const volatile void*, int)’ writing 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
>     78 | { void* data; __atomic_load((void* const volatile *)p, &data, __ATOMIC_ACQUIRE); return data; }
>        |               ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Done with /home//jdk8u-dev-master/hotspot/src/share/vm/compiler/compilerOracle.cpp
>
> `-Werror=stringop-overflow=`,
>
> I'll test it on x86 architecture, and I'll report back with the results.
>
> -------------
>
> PR Comment: https://git.openjdk.org/jdk8u-dev/pull/479#issuecomment-2058078166
>
-- 
Simon Tooke
Principal Software Engineer - Java Platform
Red Hat Canada, Inc.
stooke at redhat.com



More information about the jdk8u-dev mailing list