Bug 51019 - unclear documentation on -fomit-frame-pointer default for -Os and different platforms
Summary: unclear documentation on -fomit-frame-pointer default for -Os and different p...
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.6.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: documentation
Depends on:
Blocks:
 
Reported: 2011-11-08 01:35 UTC by Alexander Peslyak
Modified: 2018-11-08 17:36 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-01-13 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Peslyak 2011-11-08 01:35:50 UTC
The texinfo documentation for GCC 4.6.2 says:

     Starting with GCC version 4.6, the default setting (when not
     optimizing for size) for 32-bit Linux x86 and 32-bit Darwin x86
     targets has been changed to `-fomit-frame-pointer'.  The default
     can be reverted to `-fno-omit-frame-pointer' by configuring GCC
     with the `--enable-frame-pointer' configure option.

     Enabled at levels `-O', `-O2', `-O3', `-Os'.

The "when not optimizing for size" comment feels contradictory to having "-Os" listed on the "Enabled at levels" line.  Also, it is not clear what the default is on other than "32-bit Linux x86 and 32-bit Darwin x86".  In practice, I observe the following behavior with GCC 4.6.2: on Linux/x86_64, -fomit-frame-pointer is the default at both -O2 and -Os (I did not test others); on Linux/i386, it is the default at -O2, but not at -Os.  This needs to be documented more clearly.
Comment 1 Andrew Pinski 2012-01-13 06:55:22 UTC
Confirmed.  Related to bug 13822.
Comment 2 sandra 2018-11-08 17:36:21 UTC
Since this issue was filed, the discussion about -fomit-frame-pointer has been rewritten so that it no longer mentions specific releases or targets.  It now says "Enabled by default at @option{-O} and higher.", which matches what the code in  opts.c does with it.