public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/37135]  New: code size increase from gcc-4.2.4-3 to 4.3.1-9 for simple fct
@ 2008-08-15 21:22 etienne_lorrain at yahoo dot fr
  2008-08-15 21:28 ` [Bug middle-end/37135] code size increase for bit-fields assignment pinskia at gcc dot gnu dot org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: etienne_lorrain at yahoo dot fr @ 2008-08-15 21:22 UTC (permalink / raw)
  To: gcc-bugs

file test.c:
----------------------
enum stdcolor_enum {
    black,    blue,         green,      cyan,
    red,      magenta,      brown,      lightgray,
    darkgray, lightblue,    lightgreen, lightcyan,
    lightred, lightmagenta, yellow,     white
    };

union mouse_color_union {
    struct mouse_color_str {
        unsigned deflt              : 4;
        unsigned leftbutton         : 4;
        unsigned rightbutton        : 4;
        unsigned middlebutton       : 4;
        unsigned topbutton          : 4;
        unsigned twobutton          : 4;
        unsigned invalid            : 4;
        unsigned infield            : 4;
        } colors;
    unsigned all;
    } conf;

const union mouse_color_union MOUSE_reset_colors = { .colors = {
    .deflt =            brown,
    .leftbutton =       red,
    .rightbutton =      green,
    .middlebutton =     lightcyan,
    .topbutton =        cyan,
    .twobutton =        magenta,
    .invalid =          black,
    .infield =          magenta,
    }};

void fct (void)
{
    conf = MOUSE_reset_colors;
}
----------------------
$ gcc-4.2 --version
gcc-4.2 (GCC) 4.2.4 (Debian 4.2.4-3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gcc-4.2 -Os -c test.c -o test.o-4.2
$ size test.o-4.2
   text    data     bss     dec     hex filename
     19       0       0      19      13 test.o-4.2
$ gcc-4.3 --version
gcc-4.3 (Debian 4.3.1-9) 4.3.1
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gcc-4.3 -Os -c test.c -o test.o-4.3
$ size test.o-4.3
   text    data     bss     dec     hex filename
     56       0       0      56      38 test.o-4.3

Basically, the assembler lines in gcc-4.2:
        movl    MOUSE_reset_colors, %eax
        movl    %eax, conf
becomes in 4.3:
        movl    $0, conf
        movb    conf+3, %al
        movb    $70, conf
        andl    $15, %eax
        orl     $80, %eax
        movb    $-78, conf+1
        movb    $83, conf+2
        movb    %al, conf+3
which looks like a regression.

Thanks, etienne.


-- 
           Summary: code size increase from gcc-4.2.4-3 to 4.3.1-9 for
                    simple fct
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: etienne_lorrain at yahoo dot fr
 GCC build triplet: debian
  GCC host triplet: i386-linux-debian
GCC target triplet: i386-linux-debian


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37135


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

end of thread, other threads:[~2009-11-25  9:40 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-15 21:22 [Bug c/37135] New: code size increase from gcc-4.2.4-3 to 4.3.1-9 for simple fct etienne_lorrain at yahoo dot fr
2008-08-15 21:28 ` [Bug middle-end/37135] code size increase for bit-fields assignment pinskia at gcc dot gnu dot org
2008-08-17 19:32 ` [Bug middle-end/37135] [4.3/4.4 Regression] " etienne_lorrain at yahoo dot fr
2008-08-22 15:33 ` rguenth at gcc dot gnu dot org
2008-08-24  9:14 ` etienne_lorrain at yahoo dot fr
2008-08-27 22:13 ` jsm28 at gcc dot gnu dot org
2008-11-21 15:30 ` jakub at gcc dot gnu dot org
2008-11-21 16:12 ` etienne_lorrain at yahoo dot fr
2008-11-21 16:23 ` jakub at gcc dot gnu dot org
2008-11-21 17:47 ` etienne_lorrain at yahoo dot fr
2008-11-21 22:18 ` jakub at gcc dot gnu dot org
2008-11-24 13:00 ` jakub at gcc dot gnu dot org
2008-11-24 22:02 ` etienne_lorrain at yahoo dot fr
2009-01-24 10:40 ` rguenth at gcc dot gnu dot org
2009-02-03 14:23 ` [Bug middle-end/37135] [4.3/4.4 Regression] code size increase for struct assignment bonzini at gnu dot org
2009-02-03 14:30 ` bonzini at gnu dot org
2009-11-25  9:40 ` jakub 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).