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]
Other format: [Raw text]

Re: optimization/7247: [3.2 regression] copy constructor missing when inlining enabled for i386


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


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