[Bug ada/81361] [8 regression] broken exception handling at -O2

iains at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Sep 15 19:27:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81361

--- Comment #21 from Iain Sandoe <iains at gcc dot gnu.org> ---
Created attachment 42183
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42183&action=edit
assembler for C++ testcase with .cfi_xxx

this gives, when linked to the GCC8 static libstdc++ (I have a patch that
actually makes -static-libstdc++ DTRT).

$ ./tt
terminate called after throwing an instance of 'int'
terminate called recursively
Abort trap: 6

With the system (GCC2.4) libstdc++.6.dylib we get:
$ ./tt
libc++abi.dylib: terminating with uncaught exception of type int
Abort trap: 6

If built using the libc++ headers and library:

CPLUS_INCLUDE_PATH=/path/to/usr/include/c++/v1 ./gcc/xg++ -Bgcc -O2 -save-temps
-v /src-local/test-eh/pr81361.C -lc++ -o tt

we get 
$ ./tt
libc++abi.dylib: terminating with uncaught exception of type int
Abort trap: 6


More information about the Gcc-bugs mailing list