From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9176 invoked by alias); 26 Oct 2004 09:19:03 -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 9107 invoked by uid 48); 26 Oct 2004 09:19:01 -0000 Date: Tue, 26 Oct 2004 09:19:00 -0000 Message-ID: <20041026091901.9106.qmail@sourceware.org> From: "reichelt at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040916205430.17526.wanderer@rsu.ru> References: <20040916205430.17526.wanderer@rsu.ru> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug middle-end/17526] [4.0 Regression] libcpp is miscompiled with -fno-pcc-struct-return -O2 X-Bugzilla-Reason: CC X-SW-Source: 2004-10/txt/msg03159.txt.bz2 List-Id: ------- Additional Comments From reichelt at gcc dot gnu dot org 2004-10-26 09:18 ------- Andrew's example in comment #26 is broken. ret.cd is set to 2 and therefore we have a.b.cd!=1 which triggers the abort. Nevertheless, here's a reduced testcase derived from comment #25: ================================ void abort(void); typedef struct { int i; } A; A foo(void) { A a = { 1 }; int j; for (j=0; j<2; j++) ; return a; } void bar(A *p) { *p = foo(); } int main(void) { A a; bar(&a); if (a.i != 1) abort(); return 0; } ================================ -- What |Removed |Added ---------------------------------------------------------------------------- CC| |reichelt at gcc dot gnu dot | |org Keywords| |monitored http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17526