public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "giovannibajo at libero dot it" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/16405] [3.4/4.0 Regression] Temporary aggregate copy not elided
Date: Thu, 07 Oct 2004 11:51:00 -0000	[thread overview]
Message-ID: <20041007115127.12100.qmail@sourceware.org> (raw)
In-Reply-To: <20040707115615.16405.guillaume.melquiond@ens-lyon.fr>


------- Additional Comments From giovannibajo at libero dot it  2004-10-07 11:51 -------
Confirmed. This won't probably be fixed in the 3.4 branch, but it should in 4.0 
at least. 

Testcase (same of original description):
------------------------------------
struct T {
  int a[128];
  T &operator+=(T const &v);
  T operator+(T const &v) const { T t = *this; t += v; return t; }
};

extern T a, b, c;
void f() { a = b + c; }
------------------------------------


The optimized dump (without the copy constructor) from mainline is:

------------------------------------
void f() ()
{
  struct T t;
  struct T * const this;
  struct T & v;
  struct T * D.1598;
  struct T D.1594;
  struct T t;

<bb 0>:
  t = b;
  operator+= (&t, &c);
  D.1594 = t;
  a = D.1594;
  return;

}
------------------------------------

So there is one additional temporary which is not removed.

I cannot see a regression anymore with the copy constructor, so this bug only 
tracks this now. Guillaume, if you still see a regression with the copy 
constructor please open a new bug report. It is wrong to track two different 
testcases (although similar) in the same report.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giovannibajo at libero dot
                   |                            |it
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|                            |3.4.3 4.0.0
      Known to work|                            |3.3.4
   Last reconfirmed|0000-00-00 00:00:00         |2004-10-07 11:51:22
               date|                            |
            Summary|Non optimized code when     |[3.4/4.0 Regression]
                   |using default copy          |Temporary aggregate copy not
                   |constructor                 |elided
   Target Milestone|---                         |3.4.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16405


  parent reply	other threads:[~2004-10-07 11:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-07 11:56 [Bug c++/16405] New: Non optimized code when using default copy constructor guillaume dot melquiond at ens-lyon dot fr
2004-07-07 15:44 ` [Bug c++/16405] " pinskia at gcc dot gnu dot org
2004-07-19  9:19 ` guillaume dot melquiond at ens-lyon dot fr
2004-10-07 11:51 ` giovannibajo at libero dot it [this message]
2004-11-01  0:45 ` [Bug tree-optimization/16405] [3.4/4.0 Regression] Temporary aggregate copy not elided mmitchel at gcc dot gnu dot org
2004-12-23  4:45 ` [Bug c++/16405] " mmitchel at gcc dot gnu dot org
2004-12-23  8:17 ` cvs-commit at gcc dot gnu dot org
2004-12-23  8:18 ` [Bug c++/16405] [3.4 " mmitchel at gcc dot gnu dot org
2004-12-23 16:27 ` cvs-commit at gcc dot gnu dot org
2005-02-13 18:38 ` cvs-commit at gcc dot gnu dot org
2005-05-19 17:40 ` mmitchel at gcc dot gnu dot org

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=20041007115127.12100.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).