c++/2666: Exceptions causes core dump when compiled with -O (Replaces 2557, w. testcase)

jeppenm@worldonline.dk jeppenm@worldonline.dk
Fri Apr 27 05:26:00 GMT 2001


>Number:         2666
>Category:       c++
>Synopsis:       Exceptions causes core dump when compiled with -O (Replaces 2557,  w. testcase)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 27 05:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jeppe N. Madsen
>Release:        2.95.3-2 (cygwin special) and 2.95.2 19991024 (release)
>Organization:
>Environment:
ENV #1
$ uname -a && g++ -v
CYGWIN_NT-5.0 JNM 1.1.8(0.34/3/2) 2001-01-31 10:08 i686 unknown
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-2/specs
gcc version 2.95.3-2 (cygwin special)

ENV #2
tyr ~ > uname -a && g++ -v
HP-UX tyr B.10.20 A 9000/735 2013360678 two-user license
Reading specs from /usr/local/stow/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/specs
gcc version 2.95.2 19991024 (release)
>Description:
The attached program core dumps on several architectures (cygwin & HP-PA) when compiled with -O
When compiled without -O everything works ok. Works fine with -O on Linux and 

- OSF1 bjarke.diku.dk V4.0 878 alpha
- SunOS mokkurkalfe.diku.dk 5.8 Generic_108528-04 sun4u sparc SUNW,Ultra-Enterprise
>How-To-Repeat:
g++ -O gccbug.cpp && ./a.out
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="gccbug.cpp"
Content-Disposition: inline; filename="gccbug.cpp"

// Compile with g++ 2.95.2 -O on an Intel architecture
// Run the program: core dump
class tester {
public:
  void test() {
    try {
      throw 1;
    }
    catch(...) {
    }
  }
};
int main() {
  try {
    tester t;
    t.test();
  }
  catch(...) {
  } 
  return 0;
}




More information about the Gcc-bugs mailing list