public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/6627: -fno-align-functions regression from 2.95
@ 2002-10-02 19:45 sayle
  0 siblings, 0 replies; 5+ messages in thread
From: sayle @ 2002-10-02 19:45 UTC (permalink / raw)
  To: audit, current, gcc-bugs, gcc-prs, jhb, nobody, obrien

Synopsis: -fno-align-functions regression from 2.95

State-Changed-From-To: analyzed->closed
State-Changed-By: sayle
State-Changed-When: Wed Oct  2 19:45:09 2002
State-Changed-Why:
    This has just been fixed on mainline CVS by the following patch:
    
    2002-10-02  Roger Sayle  <roger@eyesopen.com>
    
            PR optimization/6627
            * toplev.c (force_align_functions_log): New global variable.
            * flags.h (force_align_functions_log): Add extern prototype.
            * varasm.c (assemble_start_function): Use it to force minimum
            function alignment.
            * config/i386/i386.h (FUNCTION_BOUNDARY): Set the correct
            minimum function alignment to one byte.
            (TARGET_PTRMEMFUNC_VBIT_LOCATION): Store the virtual bit in
            the least significant bit of vtable member function pointers.
            * tree.h (enum ptrmemfunc_vbit_where_t): Move definition to
            here from cp/cp-tree.h.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6627


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

* Re: optimization/6627: -fno-align-functions regression from 2.95
@ 2002-06-27 13:38 Gerald Pfeifer
  0 siblings, 0 replies; 5+ messages in thread
From: Gerald Pfeifer @ 2002-06-27 13:38 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR optimization/6627; it has been noted by GNATS.

From: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
To: gcc-gnats@gcc.gnu.org, <gcc-prs@gcc.gnu.org>
Cc: "David O'Brien" <obrien@freebsd.org>, <jhb@freebsd.org>,
   <current@freebsd.org>, <audit@freebsd.org>
Subject: Re: optimization/6627: -fno-align-functions regression from 2.95
Date: Thu, 27 Jun 2002 22:28:10 +0200 (CEST)

 This *is* a regression (even if it may be hard to fix on the release
 branch), so I'm raising it's priority.
 
 Gerald
 


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

* Re: optimization/6627: -fno-align-functions regression from 2.95
@ 2002-06-27 13:36 obrien
  0 siblings, 0 replies; 5+ messages in thread
From: obrien @ 2002-06-27 13:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR optimization/6627; it has been noted by GNATS.

From: obrien@freebsd.org
To: audit@freebsd.org, obrien@freebsd.org, gcc-gnats@gcc.gnu.org,
   gcc-prs@gcc.gnu.org, current@freebsd.org, jhb@freebsd.org,
   gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: optimization/6627: -fno-align-functions regression from 2.95
Date: Thu, 27 Jun 2002 13:12:08 -0700 (PDT)

 rth said at http://gcc.gnu.org/ml/gcc/2002-05/msg00989.html he would not
 raise the priority for 3.1.1.  But this is a regression and I hope maybe
 something can be done about it.  Maybe a fix based on a #define one must
 explicitly turn on when building GCC.
 
 I do not see why a fix cannot go in (in some form).  If a C++ user asks for
 an alignment of `1' then give it to them -- since when has C/C++ been about
 not letting the user shoot their foot off?  Or, can't the fix take into
 account that I am compiling C and not C++?
 
 This regression is still causing us problems in FreeBSD's boot code due to
 the larger size the code produces.  I'm sure this could be an issue for
 some embedded users.


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

* Re: optimization/6627: -fno-align-functions regression from 2.95
@ 2002-05-13 16:52 rth
  0 siblings, 0 replies; 5+ messages in thread
From: rth @ 2002-05-13 16:52 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jhb, nobody, obrien

Synopsis: -fno-align-functions regression from 2.95

State-Changed-From-To: open->analyzed
State-Changed-By: rth
State-Changed-When: Mon May 13 16:52:40 2002
State-Changed-Why:
    http://gcc.gnu.org/ml/gcc/2002-05/msg00989.html

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6627


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

* optimization/6627: -fno-align-functions regression from 2.95
@ 2002-05-10 11:46 obrien
  0 siblings, 0 replies; 5+ messages in thread
From: obrien @ 2002-05-10 11:46 UTC (permalink / raw)
  To: gcc-gnats; +Cc: John Baldwin


>Number:         6627
>Category:       optimization
>Synopsis:       -fno-align-functions regression from 2.95
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Fri May 10 11:46:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     David O'Brien
>Release:        3.1 20020509 (prerelease) [FreeBSD]
>Organization:
The FreeBSD Project
>Environment:
System: FreeBSD dragon.nuxi.com 5.0-CURRENT FreeBSD 5.0-CURRENT #261: Mon May 6 11:39:49 PDT 2002 rootk@dragon.nuxi.com:/FBSD/src/sys/i386/compile/DRAGON i386


	
host: i386-portbld-freebsd5.0
build: i386-portbld-freebsd5.0
target: i386-portbld-freebsd5.0
configured with: ./..//gcc-20020429/configure --disable-nls --with-gnu-as --with-gnu-ld --with-gxx-include-dir=/opt/gcc31.2002-04-29/lib/gcc-lib/i386-portbld-freebsd5.0/3.1/include/g++ --disable-libgcj --disable-shared --prefix=/opt/gcc31.2002-04-29 i386-portbld-freebsd5.0
>Description:

	from http://gcc.gnu.org/ml/gcc-bugs/2002-05/msg00372.html

We are currently trying to change the system compiler in FreeBSD over
to gcc 3.1.x.  Some of the C code we compile is in the bootstrap where
space is a real premium, thus we want to avoid as much padding as
possible.  Since it's just boot code that isn't executed all that often
the performance hit from making the code more compact (i.e. if it's
misaligned) is much less important than the space taken up by padding.
The problem we are seeing is that -fno-align-functions doesn't seem to
actually be disabling function alignment (and possibly similar for the
other -fno-align-foo parameters).

Using the program below, this is what the current system compiler (2.95.4
turns out:

$ cc -v
Using builtin specs.
gcc version 2.95.4 20020320 [FreeBSD]
$ cc -Os -malign-functions=0 test.c -c
$ objdump -d test.o

test.o:     file format elf32-i386

Disassembly of section .text:

00000000 <foo>:
   0:   55                      push   %ebp
   1:   89 e5                   mov    %esp,%ebp
   3:   c9                      leave  
   4:   c3                      ret    

00000005 <bar>:
   5:   55                      push   %ebp
   6:   89 e5                   mov    %esp,%ebp
   8:   c9                      leave  
   9:   c3                      ret    
   a:   89 f6                   mov    %esi,%esi

Note <bar> starts at offset 05 right after <foo>.

This is what a CVS version of gcc 3.1 turns out:

$ gcc31 -v
Reading specs from /usr/local/lib/gcc-lib/i386-portbld-freebsd5.0/3.1/specs
Configured with: ./..//gcc-20020429/configure --disable-nls --with-gnu-as
--with-gnu-ld
--with-gxx-include-dir=/usr/local/lib/gcc-lib/i386-portbld-freebsd5.0/3.1/includ
e/g++ --disable-libgcj --disable-shared --prefix=/usr/local
i386-portbld-freebsd5.0
Thread model: posix
gcc version 3.1 20020429 (prerelease) [FreeBSD]
$ gcc31 -Os -malign-functions=0 -c test.c
cc1: warning: -malign-functions is obsolete, use -falign-functions
$ objdump -d test.o

test.o:     file format elf32-i386

Disassembly of section .text:

00000000 <foo>:
   0:   55                      push   %ebp
   1:   89 e5                   mov    %esp,%ebp
   3:   c9                      leave  
   4:   c3                      ret    
   5:   90                      nop    

00000006 <bar>:
   6:   55                      push   %ebp
   7:   89 e5                   mov    %esp,%ebp
   9:   c9                      leave  
   a:   c3                      ret    
   b:   90                      nop    

Note the extra 'nop' after <foo> now to force <bar> to be
aligned.  If I use '-fno-align-functions' in place of
'-malign-functions=0' above, I get the same result.

Now a few extra nop's after each function isn't going to
add but so much "bloat" but we have seen a 7k program go from
128 bytes to spare to being 64 bytes too large, which is a
difference of 244 bytes.  As far as I can tell, the difference
in size is due to alignment padding for functions, labels, loops,
etc.

>How-To-Repeat:

void foo(void);
void bar(void);

void
foo(void)
{
}

void
bar(void)
{
}

gcc295 -Os -malign-functions=0 -c test.c
gcc31 -Os -malign-functions=0 -c test.c

>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2002-10-03  2:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-02 19:45 optimization/6627: -fno-align-functions regression from 2.95 sayle
  -- strict thread matches above, loose matches on Subject: below --
2002-06-27 13:38 Gerald Pfeifer
2002-06-27 13:36 obrien
2002-05-13 16:52 rth
2002-05-10 11:46 obrien

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