https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67696
Bug ID: 67696 Summary: libbacktrace prints C++ demangled name for Fortran symbol Product: gcc Version: 5.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: Joost.VandeVondele at mat dot ethz.ch Target Milestone: --- The backtrace printed on abort can contain demangled names, instead of the Fortran symbols. In the example below, cp__b becomes cp(bool) : > cat test.f90 MODULE foo CONTAINS SUBROUTINE cp__b() CALL ABORT() END SUBROUTINE END MODULE PROGRAM test USE foo CALL cp__b() END PROGRAM > gfortran -g test.f90 ; ./a.out Program aborted. Backtrace: #0 0x7FE4810C6B87 #1 0x7FE4810C79C2 #2 0x7FE481198538 #3 0x4006A3 in __foo_MOD_cp(bool) at test.f90:4 #4 0x4006AC in test at test.f90:10 Aborted I actually notice the same wrong name is printed if a backtrace is asked in gdb: (gdb) bt #0 0x0000003ba4a32625 in raise () from /lib64/libc.so.6 #1 0x0000003ba4a33e05 in abort () from /lib64/libc.so.6 #2 0x00007ffff7cf99a9 in _gfortrani_sys_abort () at /data/vjoost/toolchain-r15694/build/gcc-5.2.0/libgfortran/runtime/error.c:180 #3 0x00007ffff7dca539 in _gfortran_abort () at /data/vjoost/toolchain-r15694/build/gcc-5.2.0/libgfortran/intrinsics/abort.c:33 #4 0x00000000004006a4 in __foo_MOD_cp(bool) () #5 0x00000000004006ad in MAIN__ () #6 0x00000000004006e4 in main () #7 0x0000003ba4a1ed5d in __libc_start_main () from /lib64/libc.so.6 #8 0x00000000004005a9 in _start ()