public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/43861]  New: -Os creates larger binaries than before in some cases (-falign-... options enabled)
@ 2010-04-22 23:48 rwahl at gmx dot de
  2010-04-22 23:51 ` [Bug middle-end/43861] " pinskia at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rwahl at gmx dot de @ 2010-04-22 23:48 UTC (permalink / raw)
  To: gcc-bugs

Hi,

I just noticed that some of my libraries are greater when compiled with gcc
4.4.3 instead of gcc 4.3.2. Diffing the output of "gcc --help=optimizers -Q
-Os" shows this in 4.3.2:

  -falign-jumps                        [disabled]
  -falign-labels                       [disabled]
  -falign-loops                        [enabled]

and this for 4.4.3:

  -falign-functions                     [enabled]
  -falign-jumps                         [enabled]
  -falign-labels                        [enabled]
  -falign-loops                         [disabled]

when explicitely disabling the alignment options then the code size shrinks.
For libxml2 in my case from 704256 to 675584 bytes.

The manual says:

  -Os disables the following optimization flags: -falign-functions
           -falign-jumps  -falign-loops -falign-labels  -freorder-blocks
           -freorder-blocks-and-partition -fprefetch-loop-arrays
           -ftree-vect-loop-version

which is not true (even not for 4.3.2 since loop alignment was enabled). Some
other opts like -freorder-blocks is enabled as well.

So is this actually a bug or is the documentation outdated or even both?


-- 
           Summary: -Os creates larger binaries than before in some cases (-
                    falign-... options enabled)
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rwahl at gmx dot de


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


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

* Re: [Bug middle-end/43861]  New: -Os creates larger binaries than before in some cases (-falign-... options enabled)
  2010-04-22 23:48 [Bug middle-end/43861] New: -Os creates larger binaries than before in some cases (-falign-... options enabled) rwahl at gmx dot de
  2010-04-22 23:51 ` [Bug middle-end/43861] " pinskia at gmail dot com
@ 2010-04-22 23:51 ` Andrew Pinski
  2010-04-23  0:10 ` [Bug middle-end/43861] " rwahl at gmx dot de
  2010-05-02 16:55 ` rwahl at gmx dot de
  3 siblings, 0 replies; 5+ messages in thread
From: Andrew Pinski @ 2010-04-22 23:51 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs

Which target is this for?

Sent from my iPhone

On Apr 22, 2010, at 4:48 PM, "rwahl at gmx dot de" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

> Hi,
>
> I just noticed that some of my libraries are greater when compiled  
> with gcc
> 4.4.3 instead of gcc 4.3.2. Diffing the output of "gcc -- 
> help=optimizers -Q
> -Os" shows this in 4.3.2:
>
>  -falign-jumps                        [disabled]
>  -falign-labels                       [disabled]
>  -falign-loops                        [enabled]
>
> and this for 4.4.3:
>
>  -falign-functions                     [enabled]
>  -falign-jumps                         [enabled]
>  -falign-labels                        [enabled]
>  -falign-loops                         [disabled]
>
> when explicitely disabling the alignment options then the code size  
> shrinks.
> For libxml2 in my case from 704256 to 675584 bytes.
>
> The manual says:
>
>  -Os disables the following optimization flags: -falign-functions
>           -falign-jumps  -falign-loops -falign-labels  -freorder- 
> blocks
>           -freorder-blocks-and-partition -fprefetch-loop-arrays
>           -ftree-vect-loop-version
>
> which is not true (even not for 4.3.2 since loop alignment was  
> enabled). Some
> other opts like -freorder-blocks is enabled as well.
>
> So is this actually a bug or is the documentation outdated or even  
> both?
>
>
> -- 
>           Summary: -Os creates larger binaries than before in some  
> cases (-
>                    falign-... options enabled)
>           Product: gcc
>           Version: 4.4.3
>            Status: UNCONFIRMED
>          Severity: normal
>          Priority: P3
>         Component: middle-end
>        AssignedTo: unassigned at gcc dot gnu dot org
>        ReportedBy: rwahl at gmx dot de
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43861
>


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

* [Bug middle-end/43861] -Os creates larger binaries than before in some cases (-falign-... options enabled)
  2010-04-22 23:48 [Bug middle-end/43861] New: -Os creates larger binaries than before in some cases (-falign-... options enabled) rwahl at gmx dot de
@ 2010-04-22 23:51 ` pinskia at gmail dot com
  2010-04-22 23:51 ` [Bug middle-end/43861] New: " Andrew Pinski
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gmail dot com @ 2010-04-22 23:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gmail dot com  2010-04-22 23:51 -------
Subject: Re:   New: -Os creates larger binaries than before in some cases
(-falign-... options enabled)

Which target is this for?

Sent from my iPhone

On Apr 22, 2010, at 4:48 PM, "rwahl at gmx dot de" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

> Hi,
>
> I just noticed that some of my libraries are greater when compiled  
> with gcc
> 4.4.3 instead of gcc 4.3.2. Diffing the output of "gcc -- 
> help=optimizers -Q
> -Os" shows this in 4.3.2:
>
>  -falign-jumps                        [disabled]
>  -falign-labels                       [disabled]
>  -falign-loops                        [enabled]
>
> and this for 4.4.3:
>
>  -falign-functions                     [enabled]
>  -falign-jumps                         [enabled]
>  -falign-labels                        [enabled]
>  -falign-loops                         [disabled]
>
> when explicitely disabling the alignment options then the code size  
> shrinks.
> For libxml2 in my case from 704256 to 675584 bytes.
>
> The manual says:
>
>  -Os disables the following optimization flags: -falign-functions
>           -falign-jumps  -falign-loops -falign-labels  -freorder- 
> blocks
>           -freorder-blocks-and-partition -fprefetch-loop-arrays
>           -ftree-vect-loop-version
>
> which is not true (even not for 4.3.2 since loop alignment was  
> enabled). Some
> other opts like -freorder-blocks is enabled as well.
>
> So is this actually a bug or is the documentation outdated or even  
> both?
>
>
> -- 
>           Summary: -Os creates larger binaries than before in some  
> cases (-
>                    falign-... options enabled)
>           Product: gcc
>           Version: 4.4.3
>            Status: UNCONFIRMED
>          Severity: normal
>          Priority: P3
>         Component: middle-end
>        AssignedTo: unassigned at gcc dot gnu dot org
>        ReportedBy: rwahl at gmx dot de
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43861
>


-- 


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


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

* [Bug middle-end/43861] -Os creates larger binaries than before in some cases (-falign-... options enabled)
  2010-04-22 23:48 [Bug middle-end/43861] New: -Os creates larger binaries than before in some cases (-falign-... options enabled) rwahl at gmx dot de
  2010-04-22 23:51 ` [Bug middle-end/43861] " pinskia at gmail dot com
  2010-04-22 23:51 ` [Bug middle-end/43861] New: " Andrew Pinski
@ 2010-04-23  0:10 ` rwahl at gmx dot de
  2010-05-02 16:55 ` rwahl at gmx dot de
  3 siblings, 0 replies; 5+ messages in thread
From: rwahl at gmx dot de @ 2010-04-23  0:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rwahl at gmx dot de  2010-04-23 00:10 -------
All my own cross compilers for ARM and x86 hosted on x86 and the native gcc in
Fedora 12 (x86) show this behavior.


-- 


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


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

* [Bug middle-end/43861] -Os creates larger binaries than before in some cases (-falign-... options enabled)
  2010-04-22 23:48 [Bug middle-end/43861] New: -Os creates larger binaries than before in some cases (-falign-... options enabled) rwahl at gmx dot de
                   ` (2 preceding siblings ...)
  2010-04-23  0:10 ` [Bug middle-end/43861] " rwahl at gmx dot de
@ 2010-05-02 16:55 ` rwahl at gmx dot de
  3 siblings, 0 replies; 5+ messages in thread
From: rwahl at gmx dot de @ 2010-05-02 16:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rwahl at gmx dot de  2010-05-02 16:55 -------
Created an attachment (id=20535)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20535&action=view)
Disable alignment when using -Os

The attached patch fixes the problem. It could be written in a more elegant way
by changing just opt1_max but this would modify the semantic of this variable
and it should be renamed accordingly.

On ARM the fix is probably a NOP because the default alignment seems to be 1
anyway but I haven't checked this.

The output of "gcc -Q --help=optimizers" seems to be broken for the alignment
options because on one hand these options are not boolean and on the other hand
falign-loops is reported as enabled when it has been disabled and vice versa.


-- 


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


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

end of thread, other threads:[~2010-05-02 16:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-22 23:48 [Bug middle-end/43861] New: -Os creates larger binaries than before in some cases (-falign-... options enabled) rwahl at gmx dot de
2010-04-22 23:51 ` [Bug middle-end/43861] " pinskia at gmail dot com
2010-04-22 23:51 ` [Bug middle-end/43861] New: " Andrew Pinski
2010-04-23  0:10 ` [Bug middle-end/43861] " rwahl at gmx dot de
2010-05-02 16:55 ` rwahl at gmx dot de

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