This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/5246: g++ 3.0.3: exception throw crash when -O -fomit-frame-pointer
- From: Craig Rodrigues <rodrigc at mediaone dot net>
- To: gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, eru at netti dot fi, gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: Wed, 02 Jan 2002 23:25:52 -0500
- Subject: Re: c++/5246: g++ 3.0.3: exception throw crash when -O -fomit-frame-pointer
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5246
The following was submitted by gbeauchesne@mandrakesoft.com:
============================================================
On 2 Jan 2002 eru@netti.fi wrote:
> This is a re-report of my earlier problem report 4955 for GCC 3.0.2,
which was
> marked closed, but the problem seems to persist in GCC 3.0.3.
> Exception throwing through multiple levels of catch+throw
> crashes, if the combination of some -O option and
-fomit-frame-pointer
> is used. Either alone works. A short self-contained test program
attached.
Here is a testcase derived from PR c++/5246 and PR c++/2447. Problem
reproduced with FSF gcc 3.0.3 and binutils 2.11.92.0.12-2mdk (based on
RH
binutils 2.11.92.0.12-8). Can't reproduce with mainline (3.1 20020102).
PS: Sorry, that's probably not the ideal file test name and location.
2002-01-02 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com>
PR c++/5246, PR c++/2447
* g++.old-deja/g++.eh/unwind2.C: New test.
--- gcc/testsuite/g++.old-deja/g++.eh/unwind2.C.eh-failure Wed Jan 2
18:54:56 2002
+++ gcc/testsuite/g++.old-deja/g++.eh/unwind2.C Wed Jan 2 18:54:03
2002
@@ -0,0 +1,33 @@
+// Reduced from PR c++/5246, PR c++/2447
+// Special g++ Options: -O -fomit-frame-pointer
+
+void step (int)
+{
+ void *sp = __builtin_alloca (0);
+}
+
+void f2 (void)
+{
+ step (2);
+ throw int();
+}
+
+void f1 (void)
+{
+ try
+ {
+ step (1);
+ f2 ();
+ step (-1);
+ }
+ catch (int)
+ {
+ step (3);
+ }
+}
+
+int main ()
+{
+ f1 ();
+ return 0;
+}
============================================================