This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/7247: [3.2 regression] copy constructor missing when inlining enabled for i386
- From: reichelt at igpm dot rwth-aachen dot de
- To: gawrilow at math dot tu-berlin dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 19 Dec 2002 14:19:46 -0000
- Subject: Re: optimization/7247: [3.2 regression] copy constructor missing when inlining enabled for i386
- Reply-to: reichelt at igpm dot rwth-aachen dot de, gawrilow at math dot tu-berlin dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Old Synopsis: copy constructor missing when inlining enabled for i386
New Synopsis: [3.2 regression] copy constructor missing when inlining enabled for i386
State-Changed-From-To: feedback->analyzed
State-Changed-By: reichelt
State-Changed-When: Thu Dec 19 06:19:45 2002
State-Changed-Why:
Confirmed (just for the record).
Here's a reduced testcase that fails on the 3.2 branch.
gcc 3.0.x, 3.3 and mainline do not seem to be affected.
--------------------------------snip here---------------------------------
extern "C" { extern int printf (const char *, ...) throw (); }
struct A {
const double d;
A() : d(1e-4) {}
void dump () const { printf("%e\n", d); }
};
struct B {
A a;
int i;
B(const A& arg) : a(arg) { arg.dump(); a.dump();}
};
struct C : B {
C(const A& arg) : B(arg) {}
};
struct X {
int i, j, k;
X() : j(0) {}
};
struct Y {
template <typename T> Y(int, const T&) {}
};
inline int foo() { X x; return 0; }
int main() {
Y y(foo(), C(A()));
return 0;
}
--------------------------------snip here---------------------------------
Just compile with "-O2" or "-O -fschedule-insns2" (on i686-pc-linux-gnu)
to get the wrong result
1.000000e-04
1.948841e-314
instead of
1.000000e-04
1.000000e-04
Regards,
Volker
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7247