6.16 gcc omit-frame pointer

Gilles Espinasse g.esp at free.fr
Wed Dec 1 23:24:12 PST 2010


----- Original Message ----- 
From: "David Jensen" <djensenlin at windstream.net>
To: <lfs-dev at linuxfromscratch.org>
Sent: Wednesday, December 01, 2010 9:01 PM
Subject: Re: 6.16 gcc omit-frame pointer


> On Wed, 01 Dec 2010 11:38:06 -0600
> Bruce Dubbs <bruce.dubbs at gmail.com> wrote:
>
> > David Jensen wrote:
> >
> > > The point of the thread is that the 'chapter 5 gcc pass 2' and the
> > > 'chapter 6 gcc' instructions and explanations are inconsistent,
> > > confusing and wrong for all but i?86.  Maybe even completely
> > > outdated.
> >
I tested the maybe outdated and it does not look so on gcc-4.4.

I made some tests to know when -fomit-frame-pointer is enabled on
gcc --version
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3

gcc -m32 -O0 -Q --help=optimizers | grep omit
  -fomit-frame-pointer                  [disabled]
gcc -m64 -O0 -Q --help=optimizers | grep omit
  -fomit-frame-pointer                  [disabled]
gcc -m32 -O1 -Q --help=optimizers | grep omit
  -fomit-frame-pointer                  [enabled]
gcc -m64 -O1 -Q --help=optimizers | grep omit
  -fomit-frame-pointer                  [enabled]
gcc -m32 -O2 -Q --help=optimizers | grep omit
  -fomit-frame-pointer                  [enabled]
gcc -m64 -O2 -Q --help=optimizers | grep omit
  -fomit-frame-pointer                  [enabled]
gcc -m32 -O3 -Q --help=optimizers | grep omit
  -fomit-frame-pointer                  [enabled]
gcc -m64 -O3 -Q --help=optimizers | grep omit
  -fomit-frame-pointer                  [enabled]

Doesn't look to make a m32|m64 difference and -f-omit-frame-pointer is by
default enabled starting to -O1

I made some build tests rebuilding chap 6 gcc-4.4.5 (this is the version I
compile) on i686.
Without --disable-bootstrap and without the -fomit-frame-pointer sed, I have
in the compilation log:
- 1056 lines that include -fomit-frame-point
- 21 lines that include -fno-omit-frame-pointer (CRTSTUFF_T_CFLAGS and
crt{begin,end}* .o)

With --disable-boot and the fomit-frame-pointer sed, I have in the log
- 759 lines that include -fomit-frame-point
- 7 lines that include -fno-omit-frame-pointer (CRTSTUFF_T_CFLAGS and
crt{begin,end}* .o)

I understand the 21 vs 7 lines on -fno-omit-frame-pointer count as that's
the 3 build with boostrap enabled with exactly the same lines.

Gilles




More information about the lfs-dev mailing list