Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8294031

GCC 12 fails to compile AArch64 due to -Wstringop-overflow

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 21
    • 20
    • hotspot

      Cross-building AArch64 with GCC 12.1.0, 12.2.0 fails like this:

      * For target hotspot_variant-server_libjvm_objs_classLoader.o:
      In file included from /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/runtime/atomic.hpp:603,
                       from /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/oops/oop.hpp:33,
                       from /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/cds/metaspaceShared.hpp:31,
                       from /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/cds/filemap.hpp:28,
                       from /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/classfile/classLoader.cpp:29:
      In member function 'T Atomic::PlatformOrderedLoad<byte_size, X_ACQUIRE>::operator()(const volatile T*) const [with T = ClassPathEntry*; long unsigned int byte_size = 8]',
          inlined from 'T Atomic::LoadImpl<T, PlatformOp, typename std::enable_if<(IsIntegral<T>::value || IsPointer<T>::value), void>::type>::operator()(const volatile T*) const [with T = ClassPathEntry*; PlatformOp = Atomic::PlatformOrderedLoad<8, X_ACQUIRE>]' at /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/runtime/atomic.hpp:391:24,
          inlined from 'static T Atomic::load_acquire(const volatile T*) [with T = ClassPathEntry*]' at /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/runtime/atomic.hpp:628:67,
          inlined from 'ClassPathEntry* ClassPathEntry::next() const' at /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/classfile/classLoader.inline.hpp:34:82,
          inlined from 'static ClassPathEntry* ClassLoader::classpath_entry(int)' at /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/classfile/classLoader.inline.hpp:55:18,
          inlined from 'static ClassPathEntry* ClassLoader::classpath_entry(int)' at /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/classfile/classLoader.inline.hpp:41:24,
          inlined from 'static oop ClassLoader::get_system_package(const char*, JavaThread*)' at /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/classfile/classLoader.cpp:1004:37:
      /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.hpp:203:66: 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=]
        203 | T operator()(const volatile T* p) const { T data; __atomic_load(const_cast<T*>(p), &data, __ATOMIC_ACQUIRE); return data; }
            | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


      Release builds notably do not fail. Only fastdebugs builds fail.

            kbarrett Kim Barrett
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: