From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18661 invoked by alias); 31 Aug 2006 19:06:09 -0000 Received: (qmail 18637 invoked by uid 48); 31 Aug 2006 19:06:01 -0000 Date: Thu, 31 Aug 2006 19:06:00 -0000 Subject: [Bug other/28917] New: try/catch block removed. too optimistic optimization? X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pluto at agmk dot net" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-08/txt/msg02796.txt.bz2 List-Id: with fixed PR26208 we can throw exceptions from signal handlers. catch() works pretty fine with complex call-chain but fails on simple testcase. #include 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