[Bug c++/16373] New: -O2 and -O3 compiler switches do not "omit-frame-pointers" as the docs. describe.
davejf at frontiernet dot net
gcc-bugzilla@gcc.gnu.org
Mon Jul 5 18:56:00 GMT 2004
The GCC man page gives the following description for the -fomit-frame-pointer
switch:
-fomit-frame-pointer
DonÂt keep the frame pointer in a register for functions that donÂt
need one. This avoids the instructions to save, set up and restore
frame pointers; it also makes an extra register available in many
functions. It also makes debugging impossible on some machines.
On some machines, such as the VAX, this flag has no effect, because
the standard calling sequence automatically handles the frame
pointer and nothing is saved by pretending it doesnÂt exist. The
machine-description macro "FRAME_POINTER_REQUIRED" controls whether
a target machine supports this flag.
Enabled at levels -O, -O2, -O3, -Os.
It appears that with the -02 and -O3 switches (and possibly -O and -Os as well),
the compiler still generates the frame pointers when the switch is not used
explicitly on the compile-time command-line. The attached assembler and
preprocessor files were created using only the -O2 and -O3 switches, and not -O
or -Os.
IMHO, what the documentation describes is correct (that the frame pointers are
to be omitted when these switches are specified) and the compiler should be
modified to not generate the frame pointer code when any of these switches are used.
Thanks.
--
Summary: -O2 and -O3 compiler switches do not "omit-frame-
pointers" as the docs. describe.
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: davejf at frontiernet dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: 3.3.2
GCC host triplet: 3.3.2
GCC target triplet: 3.3.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16373
More information about the Gcc-bugs
mailing list