public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: reichelt@igpm.rwth-aachen.de
To: gawrilow@math.tu-berlin.de, gcc-bugs@gcc.gnu.org,
	gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org
Subject: Re: optimization/7247: [3.2 regression] copy constructor missing when inlining enabled for i386
Date: Thu, 19 Dec 2002 06:19:00 -0000	[thread overview]
Message-ID: <20021219141946.15629.qmail@sources.redhat.com> (raw)

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


             reply	other threads:[~2002-12-19 14:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-19  6:19 reichelt [this message]
2003-01-14 22:56 Janis Johnson
2003-04-25 19:51 jbuck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021219141946.15629.qmail@sources.redhat.com \
    --to=reichelt@igpm.rwth-aachen.de \
    --cc=gawrilow@math.tu-berlin.de \
    --cc=gcc-bugs@gcc.gnu.org \
    --cc=gcc-gnats@gcc.gnu.org \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).