UBSAN boostrap compiler sees: $ UBSAN_OPTIONS="print_stacktrace=1" ./xgcc -B. /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/debug/trivial.c -c -gstabs -fno-diagnostics-show-caret -fdiagnostics-color=never -gstabs -S -o trivial.S ../../gcc/dbxout.c:684:14: runtime error: negation of -9223372036854775808 cannot be represented in type 'long int'; cast to an unsigned type to negate this value to itself #0 0xd673a5 in stabstr_D ../../gcc/dbxout.c:684 #1 0xd73400 in dbxout_range_type ../../gcc/dbxout.c:1745 #2 0xd6eba8 in dbxout_type ../../gcc/dbxout.c:2042 #3 0xd75c43 in dbxout_symbol(tree_node*, int) ../../gcc/dbxout.c:2865 #4 0xd783b2 in dbxout_init ../../gcc/dbxout.c:1079 #5 0x74faa0 in lang_dependent_init ../../gcc/toplev.c:1920 #6 0x74faa0 in do_compile ../../gcc/toplev.c:2118 #7 0x74faa0 in toplev::main(int, char**) ../../gcc/toplev.c:2267 #8 0x751cba in main ../../gcc/main.c:39 #9 0x7fb2075a06e4 in __libc_start_main (/lib64/libc.so.6+0x206e4) #10 0x751de8 in _start (/home/marxin/Programming/gcc/objdir/gcc/cc1+0x751de8)
The stabs support is obsolete and unmaintained. The best solution is to disable the stabs support for the compiler target you are trying to build. If you disable the stabs support for your target, the testsuite will stop running stabs tests, and you won't see these errors anymore. The stabs support can be disabled by removing the dbxelf.h reference in config.sub for x86 linux (and optionally other x86 targets), or by undeffing DBX_DEBUGGING_INFO somewhere in the config/i386 dir.
Thanks for explanation. Do you plan to remove it in the future from GCC or will you leave it there unmaintained?
Created attachment 43963 [details] gcc8-pr84637.patch I think in this case the fix is rather obvious (though, untested so far and not proposing it for GCC8).
Author: jakub Date: Tue Apr 17 22:18:47 2018 New Revision: 259451 URL: https://gcc.gnu.org/viewcvs?rev=259451&root=gcc&view=rev Log: PR debug/84637 * dbxout.c (dbxout_int): Perform negation in unsigned int type. (stabstr_D): Change type of unum from unsigned int to unsigned HOST_WIDE_INT. Perform negation in unsigned HOST_WIDE_INT type. Modified: trunk/gcc/ChangeLog trunk/gcc/dbxout.c
Fixed.