public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/34146]  New: [4.1/4.2/4.3 Regression] Inefficient code with compound literals inside a CONSTRUCTO
@ 2007-11-19  4:57 pinskia at gcc dot gnu dot org
  2007-11-19  4:57 ` [Bug c/34146] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-11-19  4:57 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-03-31  0:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-19  4:57 [Bug c/34146] New: [4.1/4.2/4.3 Regression] Inefficient code with compound literals inside a CONSTRUCTO pinskia at gcc dot gnu dot org
2007-11-19  4:57 ` [Bug c/34146] " pinskia at gcc dot gnu dot org
2007-11-19 14:58 ` jakub at gcc dot gnu dot org
2007-11-20 10:36 ` jakub at gcc dot gnu dot org
2007-11-20 11:00 ` [Bug c/34146] [4.1/4.2 " jakub at gcc dot gnu dot org
2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org
2008-05-19 20:30 ` jsm28 at gcc dot gnu dot org
2008-07-04 22:54 ` [Bug c/34146] [4.2 " jsm28 at gcc dot gnu dot org
2009-03-31  0:39 ` jsm28 at gcc dot gnu dot org

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).