https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111374
Simon Marchi <simon.marchi at polymtl dot ca> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution|--- |FIXED --- Comment #2 from Simon Marchi <simon.marchi at polymtl dot ca> --- So, I don't see that specific failure with gdb/d-lang.c nowadays, but I see one similar with gdb/symfile.c (see below). However, it seems fixed with gcc 15. I just tested with these versions: 11.5.0: works 12.5.0: fails 13.4.0: fails 14.3.0: fails 15.2.0: works I am able to build GDB with gcc 15, with "-O2 -fsanitize=address -D_GLIBCXX_DEBUG=1", so I will close this bug. --- For reference, the error I get with symfile.c: $ ccache /opt/gcc/14.3.0/bin/g++ -x c++ -I. -I/home/smarchi/src/binutils-gdb/gdb -I/home/smarchi/src/binutils-gdb/gdb/config -include /home/smarchi/src/binutils-gdb/gdb/defs.h -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I/home/smarchi/src/binutils-gdb/gdb/../include/opcode -I../bfd -I/home/smarchi/src/binutils-gdb/gdb/../bfd -I/home/smarchi/src/binutils-gdb/gdb/../include -I../libdecnumber -I/home/smarchi/src/binutils-gdb/gdb/../libdecnumber -I/home/smarchi/src/binutils-gdb/gdb/../gnulib/import -I../gnulib/import -I/home/smarchi/src/binutils-gdb/gdb/.. -I.. -I/home/smarchi/src/binutils-gdb/gdb/../libbacktrace/ -I../libbacktrace/ -DTUI=1 -I/usr/include/guile/3.0 -I/usr/include/python3.13 -I/usr/include/python3.13 -I/home/smarchi/src/binutils-gdb/gdb/.. -pthread -Wall -Wdeprecated-copy -Wdeprecated-copy-dtor -Wduplicated-cond -Wempty-body -Wimplicit-fallthrough=5 -Wmissing-declarations -Wno-char-subscripts -Wno-mismatched-tags -Wno-sign-compare -Wno-error=maybe-uninitialized -Wno-switch -Wno-unused -Wpointer-arith -Wredundant-move -Wshadow=local -Wstrict-null-sentinel -Wsuggest-override -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-const-variable=1 -Wunused-function -Wunused-label -Wunused-local-typedefs -Wunused-value -Wunused-variable -Wvla -Wformat -Wformat-nonliteral -fsanitize=undefined -fno-sanitize-recover=undefined -Werror -g3 -O2 -fsanitize=address -D_GLIBCXX_DEBUG=1 -fmax-errors=1 -fdiagnostics-color=always -c -o symfile.o -MT symfile.o -MMD -MP -MF ./.deps/symfile.Tpo /home/smarchi/src/binutils-gdb/gdb/symfile.c In file included from /opt/gcc/14.3.0/include/c++/14.3.0/bits/hashtable_policy.h:36, from /opt/gcc/14.3.0/include/c++/14.3.0/bits/hashtable.h:35, from /opt/gcc/14.3.0/include/c++/14.3.0/bits/unordered_map.h:33, from /opt/gcc/14.3.0/include/c++/14.3.0/unordered_map:41, from /opt/gcc/14.3.0/include/c++/14.3.0/functional:63, from /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/ptid.h:35, from /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/common-defs.h:212, from /home/smarchi/src/binutils-gdb/gdb/defs.h:26, from <command-line>: In static member function ‘static _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = const add_symbol_file_command(const char*, int)::sect_opt; _Up = add_symbol_file_command(const char*, int)::sect_opt; bool _IsMove = false]’, inlined from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const add_symbol_file_command(const char*, int)::sect_opt*; _OI = add_symbol_file_command(const char*, int)::sect_opt*]’ at /opt/gcc/14.3.0/include/c++/14.3.0/bits/stl_algobase.h:521:30, inlined from ‘_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const add_symbol_file_command(const char*, int)::sect_opt*; _OI = add_symbol_file_command(const char*, int)::sect_opt*]’ at /opt/gcc/14.3.0/include/c++/14.3.0/bits/stl_algobase.h:548:42, inlined from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const add_symbol_file_command(const char*, int)::sect_opt*; _OI = add_symbol_file_command(const char*, int)::sect_opt*]’ at /opt/gcc/14.3.0/include/c++/14.3.0/bits/stl_algobase.h:555:31, inlined from ‘_OI std::copy(_II, _II, _OI) [with _II = const add_symbol_file_command(const char*, int)::sect_opt*; _OI = add_symbol_file_command(const char*, int)::sect_opt*]’ at /opt/gcc/14.3.0/include/c++/14.3.0/bits/stl_algobase.h:651:7, inlined from ‘static _ForwardIterator std::__uninitialized_copy<true>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const add_symbol_file_command(const char*, int)::sect_opt*; _ForwardIterator = add_symbol_file_command(const char*, int)::sect_opt*]’ at /opt/gcc/14.3.0/include/c++/14.3.0/bits/stl_uninitialized.h:147:27, inlined from ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const add_symbol_file_command(const char*, int)::sect_opt*; _ForwardIterator = add_symbol_file_command(const char*, int)::sect_opt*]’ at /opt/gcc/14.3.0/include/c++/14.3.0/bits/stl_uninitialized.h:185:15, inlined from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, allocator<_Tp>&) [with _InputIterator = const add_symbol_file_command(const char*, int)::sect_opt*; _ForwardIterator = add_symbol_file_command(const char*, int)::sect_opt*; _Tp = add_symbol_file_command(const char*, int)::sect_opt]’ at /opt/gcc/14.3.0/include/c++/14.3.0/bits/stl_uninitialized.h:373:37, inlined from ‘void std::__cxx1998::vector<_Tp, _Alloc>::_M_range_initialize_n(_Iterator, _Iterator, size_type) [with _Iterator = const add_symbol_file_command(const char*, int)::sect_opt*; _Tp = add_symbol_file_command(const char*, int)::sect_opt; _Alloc = std::allocator<add_symbol_file_command(const char*, int)::sect_opt>]’ at /opt/gcc/14.3.0/include/c++/14.3.0/bits/stl_vector.h:1719:37, inlined from ‘std::__cxx1998::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = add_symbol_file_command(const char*, int)::sect_opt; _Alloc = std::allocator<add_symbol_file_command(const char*, int)::sect_opt>]’ at /opt/gcc/14.3.0/include/c++/14.3.0/bits/stl_vector.h:685:23, inlined from ‘std::__debug::vector<_Tp, _Allocator>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = add_symbol_file_command(const char*, int)::sect_opt; _Allocator = std::allocator<add_symbol_file_command(const char*, int)::sect_opt>]’ at /opt/gcc/14.3.0/include/c++/14.3.0/debug/vector:243:23, inlined from ‘void add_symbol_file_command(const char*, int)’ at /home/smarchi/src/binutils-gdb/gdb/symfile.c:2205:57: /opt/gcc/14.3.0/include/c++/14.3.0/bits/stl_algobase.h:452:30: error: ‘void* __builtin_memmove(void*, const void*, long unsigned int)’ forming offset 16 is out of the bounds [0, 16] [-Werror=array-bounds=] 452 | __builtin_memmove(__result, __first, sizeof(_Tp) * _Num); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors