This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/34146] New: [4.1/4.2/4.3 Regression] Inefficient code with compound literals inside a CONSTRUCTO
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Nov 2007 04:57:12 -0000
- Subject: [Bug c/34146] New: [4.1/4.2/4.3 Regression] Inefficient code with compound literals inside a CONSTRUCTO
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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