public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/23524] New: bigger version of mov + cmp produced
@ 2005-08-23  5:55 dann at godzilla dot ics dot uci dot edu
  2005-08-23  6:06 ` [Bug rtl-optimization/23524] " dann at godzilla dot ics dot uci dot edu
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2005-08-23  5:55 UTC (permalink / raw)
  To: gcc-bugs

Compiling the code in the attachment using -O2 -march=i686 4.1 produces bigger 
code than 4.0. 
4.0 produces:         
   movl    xtermWidgetClass, %eax
   cmpl    %eax, 4(%edx)
4.1 produces: 
   movl    4(%edx), %eax
   cmpl    xtermWidgetClass, %eax

the 4.1 version is 1 byte bigger.

This is one of the reasons for the code size increase in PR23153.

-- 
           Summary: bigger version of mov + cmp produced
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug rtl-optimization/23524] bigger version of mov + cmp produced
  2005-08-23  5:55 [Bug rtl-optimization/23524] New: bigger version of mov + cmp produced dann at godzilla dot ics dot uci dot edu
@ 2005-08-23  6:06 ` dann at godzilla dot ics dot uci dot edu
  2005-08-23 11:31 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2005-08-23  6:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dann at godzilla dot ics dot uci dot edu  2005-08-23 05:55 -------
Created an attachment (id=9560)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9560&action=view)
Testcase for this bug


-- 


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


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

* [Bug rtl-optimization/23524] bigger version of mov + cmp produced
  2005-08-23  5:55 [Bug rtl-optimization/23524] New: bigger version of mov + cmp produced dann at godzilla dot ics dot uci dot edu
  2005-08-23  6:06 ` [Bug rtl-optimization/23524] " dann at godzilla dot ics dot uci dot edu
@ 2005-08-23 11:31 ` pinskia at gcc dot gnu dot org
  2005-08-23 18:07 ` dann at godzilla dot ics dot uci dot edu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-23 11:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-23 11:27 -------
You really should know that we only care about code size at -Os.  We care about performance 
regressions though at -O2.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|bigger version of mov + cmp |bigger version of mov + cmp
                   |produced                    |produced


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


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

* [Bug rtl-optimization/23524] bigger version of mov + cmp produced
  2005-08-23  5:55 [Bug rtl-optimization/23524] New: bigger version of mov + cmp produced dann at godzilla dot ics dot uci dot edu
  2005-08-23  6:06 ` [Bug rtl-optimization/23524] " dann at godzilla dot ics dot uci dot edu
  2005-08-23 11:31 ` pinskia at gcc dot gnu dot org
@ 2005-08-23 18:07 ` dann at godzilla dot ics dot uci dot edu
  2005-08-23 18:08   ` Andrew Pinski
  2005-08-23 18:15 ` pinskia at physics dot uc dot edu
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 8+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2005-08-23 18:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dann at godzilla dot ics dot uci dot edu  2005-08-23 18:05 -------
(In reply to comment #2)
> You really should know that we only care about code size at -Os.  We care
about performance 
> regressions though at -O2.

Code size is important for performance for modern processors. Small I-cache (and
I-TLB) footprint for otherwise equivalent code results in better performance.

BTW, this is a 4.1 regression. 


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |23153
              nThis|                            |


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


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

* Re: [Bug rtl-optimization/23524] bigger version of mov + cmp produced
  2005-08-23 18:07 ` dann at godzilla dot ics dot uci dot edu
@ 2005-08-23 18:08   ` Andrew Pinski
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Pinski @ 2005-08-23 18:08 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs


On Aug 23, 2005, at 2:06 PM, dann at godzilla dot ics dot uci dot edu 
wrote:

>
> ------- Additional Comments From dann at godzilla dot ics dot uci dot 
> edu  2005-08-23 18:05 -------
> (In reply to comment #2)
>> You really should know that we only care about code size at -Os.  We 
>> care
> about performance
>> regressions though at -O2.
>
> Code size is important for performance for modern processors. Small 
> I-cache (and
> I-TLB) footprint for otherwise equivalent code results in better 
> performance.

Then use -Os every where instead.  You will see that the overall code 
size for 4.1
has reduced from 4.0.

-- Pinski


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

* [Bug rtl-optimization/23524] bigger version of mov + cmp produced
  2005-08-23  5:55 [Bug rtl-optimization/23524] New: bigger version of mov + cmp produced dann at godzilla dot ics dot uci dot edu
                   ` (2 preceding siblings ...)
  2005-08-23 18:07 ` dann at godzilla dot ics dot uci dot edu
@ 2005-08-23 18:15 ` pinskia at physics dot uc dot edu
  2005-08-23 18:23 ` dann at godzilla dot ics dot uci dot edu
  2005-09-07 22:05 ` dann at godzilla dot ics dot uci dot edu
  5 siblings, 0 replies; 8+ messages in thread
From: pinskia at physics dot uc dot edu @ 2005-08-23 18:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at physics dot uc dot edu  2005-08-23 18:07 -------
Subject: Re:  bigger version of mov + cmp produced


On Aug 23, 2005, at 2:06 PM, dann at godzilla dot ics dot uci dot edu 
wrote:

>
> ------- Additional Comments From dann at godzilla dot ics dot uci dot 
> edu  2005-08-23 18:05 -------
> (In reply to comment #2)
>> You really should know that we only care about code size at -Os.  We 
>> care
> about performance
>> regressions though at -O2.
>
> Code size is important for performance for modern processors. Small 
> I-cache (and
> I-TLB) footprint for otherwise equivalent code results in better 
> performance.

Then use -Os every where instead.  You will see that the overall code 
size for 4.1
has reduced from 4.0.

-- Pinski



-- 


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


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

* [Bug rtl-optimization/23524] bigger version of mov + cmp produced
  2005-08-23  5:55 [Bug rtl-optimization/23524] New: bigger version of mov + cmp produced dann at godzilla dot ics dot uci dot edu
                   ` (3 preceding siblings ...)
  2005-08-23 18:15 ` pinskia at physics dot uc dot edu
@ 2005-08-23 18:23 ` dann at godzilla dot ics dot uci dot edu
  2005-09-07 22:05 ` dann at godzilla dot ics dot uci dot edu
  5 siblings, 0 replies; 8+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2005-08-23 18:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dann at godzilla dot ics dot uci dot edu  2005-08-23 18:15 -------
(In reply to comment #4)
>
> Then use -Os every where instead.  You will see that the overall code 
> size for 4.1
> has reduced from 4.0.

That might be true, but -Os is not always an option. If there's a good reason
for -O2 to generate bigger code, then so be it, but that does not seem to be the
case for the code in this PR (at least AFAICT).

-- 


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


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

* [Bug rtl-optimization/23524] bigger version of mov + cmp produced
  2005-08-23  5:55 [Bug rtl-optimization/23524] New: bigger version of mov + cmp produced dann at godzilla dot ics dot uci dot edu
                   ` (4 preceding siblings ...)
  2005-08-23 18:23 ` dann at godzilla dot ics dot uci dot edu
@ 2005-09-07 22:05 ` dann at godzilla dot ics dot uci dot edu
  5 siblings, 0 replies; 8+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2005-09-07 22:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dann at godzilla dot ics dot uci dot edu  2005-09-07 22:05 -------
It seems that expand generates different insns in 4.0 and 4.1 for the comparison
in question:

4.0 generates: (from .00.expand)

(insn 15 13 16 1 (set (reg/f:SI 62)
        (mem/s/f:SI (plus:SI (reg/v/f:SI 58 [ gw ])
                (const_int 4 [0x4])) [5 <variable>.core.widget_class+0 S4 A32]))
-1 (nil)
    (nil))

(insn 16 15 17 1 (set (reg/f:SI 63)
        (mem/f/i:SI (symbol_ref:SI ("xtermWidgetClass") [flags 0x40] <var_decl
0xb7a8b0d8 x
termWidgetClass>) [5 xtermWidgetClass+0 S4 A32])) -1 (nil)
    (nil))

(insn 17 16 18 1 (set (reg:CCZ 17 flags)
        (compare:CCZ (reg/f:SI 62)
            (reg/f:SI 63))) -1 (nil)
    (nil))

4.1 generates: 

(insn 15 13 16 1 (set (reg:SI 62)
        (mem/s/f:SI (plus:SI (reg/v/f:SI 58 [ gw ])
                (const_int 4 [0x4])) [5 <variable>.core.widget_class+0 S4 A32]))
-1 (nil)
    (nil))

(insn 16 15 17 1 (set (reg:CCZ 17 flags)
        (compare:CCZ (reg:SI 62)
            (mem/f/i:SI (symbol_ref:SI ("xtermWidgetClass") [flags 0x40]
<var_decl 0xb7b510
b0 xtermWidgetClass>) [5 xtermWidgetClass+0 S4 A32]))) -1 (nil)
    (nil))



-- 


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


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

end of thread, other threads:[~2005-09-07 22:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-23  5:55 [Bug rtl-optimization/23524] New: bigger version of mov + cmp produced dann at godzilla dot ics dot uci dot edu
2005-08-23  6:06 ` [Bug rtl-optimization/23524] " dann at godzilla dot ics dot uci dot edu
2005-08-23 11:31 ` pinskia at gcc dot gnu dot org
2005-08-23 18:07 ` dann at godzilla dot ics dot uci dot edu
2005-08-23 18:08   ` Andrew Pinski
2005-08-23 18:15 ` pinskia at physics dot uc dot edu
2005-08-23 18:23 ` dann at godzilla dot ics dot uci dot edu
2005-09-07 22:05 ` dann at godzilla dot ics dot uci dot edu

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