This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: c++/4500


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]