From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19640 invoked by alias); 26 Aug 2005 14:30:43 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 19624 invoked by uid 48); 26 Aug 2005 14:30:40 -0000 Date: Fri, 26 Aug 2005 14:59:00 -0000 Message-ID: <20050826143040.19622.qmail@sourceware.org> From: "rguenth at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050813080257.23372.guillaume.melquiond@ens-lyon.fr> References: <20050813080257.23372.guillaume.melquiond@ens-lyon.fr> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/23372] [4.0/4.1 Regression] Temporary aggregate copy not elided when passing parameters by value X-Bugzilla-Reason: CC X-SW-Source: 2005-08/txt/msg03032.txt.bz2 List-Id: ------- Additional Comments From rguenth at gcc dot gnu dot org 2005-08-26 14:30 ------- For your last testcase, struct A { int a[1000]; } A f(); void g(A); void h() { g(f()); } all of 3.4 and 4.1 produce exactly two temporaries. One to dump the result of f(), which get's copied to a new temp passed to g(). 4.0 though produces one extra unnecessary copy. The same holds true for C testcases. -- What |Removed |Added ---------------------------------------------------------------------------- GCC host triplet|i486-linux-gnu | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23372