PR 16373: -fomit-frame-pointer when optimizing on x86

Jakub Jelinek jakub@redhat.com
Thu Dec 2 11:07:00 GMT 2004


Hi!

Sorry for getting to this so late.
I have rebuilt current RHEL-4 tree 3 times (with GCC 3.4.3-RH,
i386, by default -O2 -march=i386 -mtune=pentium4 unless packages
override it, once normally, once with
%{!pg:%{!p:%{!profile:%{!fasynchronous-unwind-tables:%{!fno-asynchronous-unwind-tables:%{!funwind-tables:%{!fno-unwind-tables:%{!fomit-frame-pointer:%{!fno-omit-frame-pointer:%{!momit-leaf-frame-pointer:%{!mno-omit-leaf-frame-pointer:-fomit-frame-pointer}}}}}}}}}}}
in specs' cc1_options and once with
%{!pg:%{!p:%{!profile:%{!fasynchronous-unwind-tables:%{!fno-asynchronous-unwind-tables:%{!funwind-tables:%{!fno-unwind-tables:%{!fomit-frame-pointer:%{!fno-omit-frame-pointer:%{!momit-leaf-frame-pointer:%{!mno-omit-leaf-frame-pointer:-fasynchronous-unwind-tables -fomit-frame-pointer}}}}}}}}}}}
in there (-fasynchronous-unwind-tables was chosen over -funwind-tables,
because surprisingly in most cases it results in smaller .eh_frame).

Then I have counted disk sizes of all ELF shared libraries and binaries.
The totals are:
803727730       813193234       885121722
for the default, -fomit-frame-pointer and
-fomit-frame-pointer -fasynchronous-unwind-tables
respectively, per-file details attached, so -fasynchronous-unwind-tables
is 8.8% disk size increase for binaries/libraries on average against
plain -fomit-frame-pointer, while -fomit-frame-pointer is 1.2% increase
over -fno-omit-frame-pointer.

For me 8.8% is acceptable and worth doing (remember the size of executables
and shared libraries is just a fraction of the total size, data files are
usually much bigger), so even if it is decided to go with just plain
-fomit-frame-pointer in CVS GCC, I'll generate .eh_frame / .eh_frame_hdr
at least for our distribution by default.

	Jakub



More information about the Gcc mailing list