From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21515 invoked by alias); 4 Apr 2013 14:22:05 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 21328 invoked by uid 48); 4 Apr 2013 14:22:00 -0000 From: "wem@trash-mail.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56840] New: a.out aborts instead of catching exception with -flto and -static-libstdc++ Date: Thu, 04 Apr 2013 14:22:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: wem@trash-mail.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg00417.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56840 Bug #: 56840 Summary: a.out aborts instead of catching exception with -flto and -static-libstdc++ Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: wem@trash-mail.com Host: CentOS release 6.4 (Final) x86_64 GNU/Linux Target: x86_64-unknown-linux-gnu Created attachment 29804 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29804 c++ program to demonstrate misbehavior $ c++ -v Using built-in specs. COLLECT_GCC=c++ COLLECT_LTO_WRAPPER=/usr/local64/gcc-4.8.0/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-4.8.0/configure --prefix=/usr/local64/gcc-4.8.0 --disable-nls --enable-threads=posix --enable-__cxa_atexit --enable-gold --with-plugin-ld=ld.gold --enable-languages=c,c++,fortran --with-arch-32=pentium-mmx Thread model: posix gcc version 4.8.0 (GCC) GNU C (GCC) version 4.8.0 (x86_64-unknown-linux-gnu) compiled by GNU C version 4.8.0, GMP version 5.1.1, MPFR version 3.1.2, MPC version 1.0.1 GNU ld (GNU Binutils) 2.23.1 /**********************************************/ /********* otto407.c ************************/ #include class MyEx { public: MyEx() {} virtual ~MyEx() {} }; int main(void) { try { throw MyEx(); } catch(MyEx&) { printf("caught MyEx\n"); } catch(...) { printf("caught ...\n"); } return 0; } /**********************************************/ $ c++ -flto otto407.c -static-libstdc++ $ ./a.out terminate called after throwing an instance of 'MyEx' terminate called recursively Aborted (core dumped) works as expected when omitting -flto or -static-libstdc++ works as expected with gcc-4.7.2 and gcc-4.5.4