This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
-fomit-frame-pointer breaks correct exception handling
- To: bug-gcc at gnu dot org
- Subject: -fomit-frame-pointer breaks correct exception handling
- From: Corey Kosak <kosak at cs dot cmu dot edu>
- Date: Thu, 08 Jun 2000 16:54:40 -0400
This is either a bug in the implementation or a bug in the documentation.
i.e. if the implementation of exceptions _requires_ the frame pointer, I would
propose that the gcc documentation include a warning to that effect.
$ g++ -v && cat b2.cc
Reading specs from /usr/local/libexec/gcc-latest-snapshot/bin/../lib/gcc-lib/i686-pc-linux/2.96/specs
gcc version 2.96 20000605 (experimental)
#include <iostream.h>
struct cow_t {
cow_t() { cout <<"created a cow\n"; }
~cow_t() { cout <<"destroyed a cow\n"; }
};
struct error_t { };
void func2()
{
throw error_t();
}
void func1()
{
cow_t cow;
func2();
}
int main()
{
try {
func1();
}
catch(...) {
cout <<"caught an exception\n";
}
}
$ g++ b2.cc && a.out
created a cow
destroyed a cow
caught an exception
$ g++ -fomit-frame-pointer b2.cc && a.out
created a cow
caught an exception
[note that the cow is not destroyed in the latter case]