This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/28917] New: try/catch block removed. too optimistic optimization?
- From: "pluto at agmk dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Aug 2006 19:06:01 -0000
- Subject: [Bug other/28917] New: try/catch block removed. too optimistic optimization?
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
with fixed PR26208 we can throw exceptions from signal handlers.
catch() works pretty fine with complex call-chain but fails on
simple testcase.
#include <csignal>
void signalHandler( int signalNumber )
{
throw 0;
}
int main()
{
signal( SIGSEGV, signalHandler );
try
{
int* p = 0;
*p = 0;
}
catch ( int )
{
}
return 0;
}
$ g++ throw_from_sighandler.cpp -O1 --save-temps && ./a.out
terminate called after throwing an instance of 'int'
zsh: abort ./a.out
main:
subq $8, %rsp
movl $_Z13signalHandleri, %esi
movl $11, %edi
call signal
movl $0, 0
movl $0, %eax
addq $8, %rsp
ret
--
Summary: try/catch block removed. too optimistic optimization?
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pluto at agmk dot net
GCC target triplet: x86-64-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28917