[Bug tree-optimization/105651] [12/13 Regression] bogus "may overlap" memcpy warning with std::string and operator+ at -O3

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 8 11:56:08 GMT 2022


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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|needs-bisection,            |
                   |needs-reduction             |
                 CC|                            |aldyh at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org

--- Comment #8 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-3347-g8af8abfbbace49e6 where new warning appeared:

    inlined from ‘std::string f()’ at pr105651.C:5:32:
/dev/shm/gcc-bisect-bin/usr/local/include/c++/12.0.0/bits/char_traits.h:355:56:
error: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’
specified bound between 9223372036854775810 and 18446744073709551615 exceeds
maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
  355 |         return static_cast<char_type*>(__builtin_memcpy(__s1, __s2,
__n));
      |                                       
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~


More information about the Gcc-bugs mailing list