Debugging ICE in GCC

Manfred Schwarb
Fri May 29 23:55:11 GMT 2020

I tried to debug fortran.dg/pr95090.f90, which showed

f951: internal compiler error: Segmentation fault
0x83cfe3c ???
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <> for instructions.

Using GDB (8.3.1), I got
#> f951="`$instdir/bin/gcc -print-prog-name=f951`"
#> gdb -ex run -ex bt --batch --args $f951 fortran.dg/pr95090.f90

Program received signal SIGSEGV, Segmentation fault.
0xf7aa5162 in __strlen_sse2_bsf () from /lib/
#0  0xf7aa5162 in __strlen_sse2_bsf () from /lib/
#1  0x083e7c3f in get_unique_hashed_string(char*, gfc_symbol*) ()
#2  0x083e85a4 in gfc_find_derived_vtab(gfc_symbol*) ()
#3  0x0847fde1 in resolve_fl_derived(gfc_symbol*) ()
#4  0x0847c717 in resolve_symbol(gfc_symbol*) ()
#5  0x084a78d0 in do_traverse_symtree(gfc_symtree*, void (*)(gfc_symtree*), void (*)(gfc_symbol*)) ()
#6  0x08487f77 in resolve_types(gfc_namespace*) ()
#7  0x0847b6e5 in gfc_resolve(gfc_namespace*) ()
#8  0x0846e9f6 in gfc_parse_file() ()
#9  0x084bebe7 in gfc_be_parse_file() ()
#10 0x08a3b59e in compile_file() ()
#11 0x083c98a5 in toplev::main(int, char**) ()
#12 0x083cd9b1 in main ()

So far so good, but there are no file locations shown, and I can't
switch frames and list code in GDB.
This although I built GCC with debug information and binaries are not stripped.

I built GCC with
#> ../configure --enable-checking=yes,extra i686-linux
#> make BOOT_CFLAGS="-O2 -ggdb" bootstrap2-lean

In desperation, I even tried
#> make BOOT_CFLAGS="-O2 -fanalyzer" bootstrap2-lean
#> make BOOT_CFLAGS="-O2 -fsanitize=address" bootstrap2-lean
but both compilation attempts failed.

Are there any magic knobs to make GDB output more useful?


More information about the Gcc-help mailing list