The following code compiles and executes correctly when compiled without -fomit-frame-pointer, but aborts when compiled with -fomit-frame-pointer: $ cat registry.cpp #include <map> #include <string> #include <iostream> using namespace std; class Registry { public: Registry() : reg() {} ~Registry() {} void getFloat(string key) { map<string, float>::iterator i = reg.find(key); if (i == reg.end()) throw new int(5); } protected: map<string, float> reg; }; int main() { Registry reg; string s = "four"; try { reg.getFloat(s); } catch (...) { cout << "caught one" << endl; } return 0; } $ g++ registry.cpp $ ./a.out caught one $ g++ -fomit-frame-pointer registry.cpp $ ./a.out Aborted $ $ g++ -v Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) $ uname -a Linux silmaril.renniedegraaf.homeip.net 2.6.8.1 #1 Sat Aug 21 16:32:26 MDT 2004 i686 athlon i386 GNU/Linux
Created attachment 6997 [details] Preprocessed source for bug 17220 Compile with -fomit-frame-pointer, and it fails. Compile without, and it works.
Confirmed with -march=i386 -fomit-frame-pointer so this is a target problem.
I could reproduce the patch previously, but after http://gcc.gnu.org/ml/gcc-patches/2004-11/msg02219.html and http://gcc.gnu.org/ml/gcc/2004-11/msg00912.html I can't. This may mean that it was a duplicate of PR6764, though I can't prove that from the Rather Large-ish test case.
Closing as fixed as I can no longer reproduce it either but I could before.