From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23779 invoked by alias); 19 Nov 2007 04:57:20 -0000 Received: (qmail 23762 invoked by uid 48); 19 Nov 2007 04:57:12 -0000 Date: Mon, 19 Nov 2007 04:57:00 -0000 Subject: [Bug c/34146] New: [4.1/4.2/4.3 Regression] Inefficient code with compound literals inside a CONSTRUCTO X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg01755.txt.bz2 Exactly like PR 33723 except the compound literal is inside a CONSTRUCTOR (you can combine compound literals and normal constructors to make this worse). Testcase: typedef struct { int f1, f2, f3, f4, f5, f6, f7, f8; long int f9, f10; int f11; } f; typedef union { f f; char s[56]; long int a; } T; void foo (void) { T t = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; test (&t); } void bar (void) { T t = { (f){ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; test (&t); } ---- Basically the fix for PR 33723 was not complete. I have a more complete fix but it does not fix the case where you include more compound literals inside another one. -- Summary: [4.1/4.2/4.3 Regression] Inefficient code with compound literals inside a CONSTRUCTO Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34146