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

Disable GCC stringop-overflow warning for affected files

XMLWordPrintable

    • b25
    • linux

        With the changes in JDK-8319883 GCC 13.2.0 generates stringop-overflow warnings on linux-x64-zero fastdebug. For example:

        In file included from src/hotspot/share/runtime/atomic.hpp:859,
                         from src/hotspot/share/oops/oop.hpp:34,
                         from src/hotspot/share/runtime/handles.hpp:29,
                         from src/hotspot/share/classfile/vmClasses.hpp:30,
                         from src/hotspot/share/classfile/javaClasses.hpp:28,
                         from src/hotspot/share/runtime/handshake.cpp:26:
        In member function 'T Atomic::PlatformLoad<byte_size>::operator()(const volatile T*) const [with T = long unsigned int; long unsigned int byte_size = 8]',
            inlined from 'T Atomic::LoadImpl<T, PlatformOp, typename std::enable_if<(std::is_integral<_Tp>::value || std::is_pointer<_Tp>::value), void>::type>::operator()(const volatile T*) const [with T = long unsigned int; PlatformOp = Atomic::PlatformLoad<8>]' at src/hotspot/share/runtime/atomic.hpp:513:24,
            inlined from 'static T Atomic::load(const volatile T*) [with T = long unsigned int]' at src/hotspot/share/runtime/atomic.hpp:870:49,
            inlined from 'T Atomic::PlatformOrderedLoad<byte_size, type>::operator()(const volatile T*) const [with T = long unsigned int; long unsigned int byte_size = 8; ScopedFenceType type = X_ACQUIRE]' at src/hotspot/share/runtime/atomic.hpp:878:24,
            inlined from 'T Atomic::LoadImpl<T, PlatformOp, typename std::enable_if<(std::is_integral<_Tp>::value || std::is_pointer<_Tp>::value), void>::type>::operator()(const volatile T*) const [with T = long unsigned int; PlatformOp = Atomic::PlatformOrderedLoad<8, X_ACQUIRE>]' at src/hotspot/share/runtime/atom\
        ic.hpp:513:24,
            inlined from 'static T Atomic::load_acquire(const volatile T*) [with T = long unsigned int]' at src/hotspot/share/runtime/atomic.hpp:884:67,
            inlined from 'uintptr_t SafepointMechanism::ThreadData::get_polling_word()' at src/hotspot/share/runtime/safepointMechanism.inline.hpp:48:30,
            inlined from 'static bool SafepointMechanism::local_poll_armed(JavaThread*)' at src/hotspot/share/runtime/safepointMechanism.inline.hpp:52:47,
            inlined from 'static bool SafepointMechanism::should_process(JavaThread*, bool)' at src/hotspot/share/runtime/safepointMechanism.inline.hpp:60:24,
            inlined from 'static void Handshake::execute(HandshakeClosure*, ThreadsListHandle*, JavaThread*)' at src/hotspot/share/runtime/handshake.cpp:404:43:
        src/hotspot/os_cpu/linux_zero/atomic_linux_zero.hpp:147:16: 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=]
          147 | __atomic_load(const_cast<T*>(src), &dest, __ATOMIC_RELAXED);
              | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        In static member function 'static void Handshake::execute(HandshakeClosure*, ThreadsListHandle*, JavaThread*)':
        cc1plus: note: destination object is likely at address zero

              mikael Mikael Vidstedt
              mikael Mikael Vidstedt
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: