c++/4500

Reichelt reichelt@igpm.rwth-aachen.de
Tue Oct 9 02:52:00 GMT 2001


Hi,

the problem seems to be the interaction between optimization and dwarf2
output. I distilled the following testcase from the PR:

int e();

struct A
{
  A (int);
  ~A ();
};

struct B
{
  void f (int);
};

template <class T> struct C
{
  void g () { A a(0); h(); }
  void h () { if (!(e() && e()>0)) { B b; b.f(e()); } }
};

template struct C<void>;

It crashes gcc 3.0.2 20010903 (prerelease) on mips-sgi-irix6.5
using "g++ -O2 -g -c <filename>" and gcc 3.0 on i686-pc-linux-gnu
using "g++ -O2 -gdwarf-2 -c <filename>". I cannot test the original
system "alphaev67-unknown-linux-gnu" however.

Remark: With i686-pc-linux-gnu you can change the conditional
expression in the if-statement to "e()" and still get the crash.

Greetings,
Volker Reichelt

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4500&database=gcc




More information about the Gcc-bugs mailing list