The following compile error was introduced by commit 8839e3f3b0d1af5d93ba1d4f667ce33936bb7db2: CXX debuginfod-support.o In file included from /usr/include/c++/11/string:40, from ../../src/gdb/../gdbsupport/ptid.h:36, from ../../src/gdb/../gdbsupport/common-defs.h:198, from ../../src/gdb/defs.h:28, from ../../src/gdb/debuginfod-support.c:19: In static member function 'static constexpr const char_type* std::char_traits<char>::find(const char_type*, std::size_t, const char_type&)', inlined from 'constexpr std::basic_string_view<_CharT, _Traits>::size_type std::basic_string_view<_CharT, _Traits>::find(_CharT, std::basic_string_view<_CharT, _Traits>::size_type) const [with _CharT = char; _Traits = std::char_traits<char>]' at /usr/include/c++/11/bits/string_view.tcc:87:41, inlined from 'constexpr std::basic_string_view<_CharT, _Traits>::size_type std::basic_string_view<_CharT, _Traits>::find_first_of(_CharT, std::basic_string_view<_CharT, _Traits>::size_type) const [with _CharT = char; _Traits = std::char_traits<char>]' at /usr/include/c++/11/string_view:431:26, inlined from 'bool debuginfod_is_enabled()' at ../../src/gdb/debuginfod-support.c:193:40: /usr/include/c++/11/bits/char_traits.h:413:62: error: 'void* __builtin_memchr(const void*, int, unsigned int)' specified bound 4294967295 may exceed maximum object size 2147483647 [-Werror=stringop-overread] 413 | return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n)); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors make[2]: *** [Makefile:1659: debuginfod-support.o] Error 1 make[2]: Leaving directory '/home/dave/gnu/binutils/objdir/gdb'
commit 716e54731f30bc60b2fc52996ebe4fc087420b2e gdb: Workaround stringop-overread warning in debuginfod-support.c on s390x commit 73a5cb257a21ad38c85932b7be4a903404d91899 gdb: Workaround stringop-overread warning in debuginfod-support.c on powerpc64 Maybe that fix should not be arch specific?
Might this be a gcc bug?
(In reply to John David Anglin from comment #2) > Might this be a gcc bug? Yes, I suspect it is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97185 where some range information is removed for some, but not all builtins causing the impossible warning message about the string size. I proposed the following patch to just always suppress this diagnostic for now on all arches: https://sourceware.org/pipermail/gdb-patches/2022-May/189603.html
Is this fixed now?
On 2022-12-23 3:04 p.m., tromey at sourceware dot org wrote: > https://sourceware.org/bugzilla/show_bug.cgi?id=29198 > > --- Comment #4 from Tom Tromey <tromey at sourceware dot org> --- > Is this fixed now? The error no longer occurs but I'm not sure the underlying cause was fixed.
The patch to suppress this warning was pushed: commit dac0515d825e788dec188fff4d5b9d4ac7383f33 Author: Mark Wielaard <mark@klomp.org> Date: Tue May 31 11:00:06 2022 +0200 gdb: Always suppress stringop-overread warning in debuginfod-support.c Just like on s390x with g++ 11.2.1 and ppc64le with g++ 11.3.1 g++ 11 on hppa produces a spurious warning for stringop-overread in debuginfod_is_enabled for url_view. Just always suppress it on all arches. https://sourceware.org/bugzilla/show_bug.cgi?id=29198 gdb/ChangeLog: * debuginfod-support.c (debuginfod_is_enabled): Always use DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD.
Ok, thanks. I'm going to close this. > The error no longer occurs but I'm not sure the underlying cause was fixed. IIUC the underlying cause is a compiler bug, so I suppose there ought to be an entry in the GCC bugzilla.
(In reply to Tom Tromey from comment #7) > IIUC the underlying cause is a compiler bug, so I suppose > there ought to be an entry in the GCC bugzilla. That would be https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97185