Hi,

On Mon, 11 Jul 2016 16:27:42 -0400 waltd...@waltdnes.org wrote:
>   I put it into CFLAGS/CCFLAGS years ago, and left it there.  During a
> discussion on the Pale Moon forum about build options, the opinion seems
> to be that "-fomit-frame-pointer" is now the default.  Is that o?
> I'd like to simplify my CFLAGS/CCFLAGS both in Gentoo and the Pale Moon
> build process.

gcc-5.3.0 manual says:
  The default setting (when not optimizing for size) for 32-bit
  GNU/Linux x86 and 32-bit Darwin x86 targets is
  -fomit-frame-pointer. You can configure GCC with the
  --enable-frame-pointer configure option to change the default.

So it depends not only on the arch, but also on how gcc was
compiled. Strange, but here Gentoo x86 I have -fomit-frame-pointer
disabled by default, so either gcc manpage is wrong or Gentoo
disables frame pointer during gcc configuration (I can't confirm the
latter after digging into toolchain eclass).

This flag is yummy on amd64 and very important on x86, since x86
has only 8 "general purpose" CPU registers, 4 of which have special
use, so only 4 are available for general computations and 1 of them
is wasted on frame-pointer, not nice. The cost of extra register is
that profiling is no longer possible and debugging may be mangled a
bit.

Looks like -fpic disables -fomit-frame-pointer at least for some
pieces of the code: hand-written 4-registers assembly makes -fpic
fail in some cases on x86 (e.g. ffmpeg).

Best regards,
Andrew Savchenko

Attachment: pgpR2ZOUwzOdB.pgp
Description: PGP signature

Reply via email to