From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15649 invoked by alias); 19 Dec 2002 14:19:46 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 15630 invoked by uid 61); 19 Dec 2002 14:19:46 -0000 Date: Thu, 19 Dec 2002 06:19:00 -0000 Message-ID: <20021219141946.15629.qmail@sources.redhat.com> To: gawrilow@math.tu-berlin.de, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org From: reichelt@igpm.rwth-aachen.de Reply-To: reichelt@igpm.rwth-aachen.de, gawrilow@math.tu-berlin.de, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: optimization/7247: [3.2 regression] copy constructor missing when inlining enabled for i386 X-SW-Source: 2002-12/txt/msg01006.txt.bz2 List-Id: 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 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