https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107087

            Bug ID: 107087
           Summary: bits/stl_algobase.h:431: warning: 'void*
                    __builtin_memcpy(void*, const void*, unsigned int)'
                    reading between 8 and 2147483644 bytes from a region
                    of size 4 [-Wstringop-overread]
           Product: gcc
           Version: 12.2.1
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---
            Target: i?86-pc-linux-gnu

Created attachment 53640
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53640&action=edit
Gzipped preprocessed output

There are bogus warnings when compiling the attached file using:

g++ -O2 3.ii -m32 -c

/usr/include/c++/12/bits/stl_algobase.h:431:30: warning: ‘void*
__builtin_memcpy(void*, const void*, unsigned int)’ reading between 8 and
2147483644 bytes from a region of size 4 [-Wstringop-overread]
  431 |             __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stl_algobase.h:431:30: warning: ‘void*
__builtin_memcpy(void*, const void*, unsigned int)’ reading between 8 and
2147483644 bytes from a region of size 4 [-Wstringop-overread]
  431 |             __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


The warnings are still there on trunk, but -Warray-bounds instead of
-Wstringop-overread.

Reply via email to