This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ACCUMULATE_OUTGOING_ARGS and the i386
- To: law at cygnus dot com
- Subject: Re: ACCUMULATE_OUTGOING_ARGS and the i386
- From: hjl at lucon dot org (H.J. Lu)
- Date: Mon, 26 Oct 1998 08:02:20 -0800 (PST)
- Cc: pcg at goof dot com, egcs at cygnus dot com
> Interesting data though. It means that it'd be an uphill battle performance
> wise. I've always felt the biggest win for this kind of stuff would be in
> being able to eliminate the frame pointer by default. Is it enough to make up
> a 3-10% loss? I don't know.
>
If we are talking about x86, I don't know if no-frame-pointer is a big
win, in code size as well as in speed. It is because you have to use
some fancy addressing modes to access stack variables when fp is not
available for it. It may slow the things down as well as make the
binary bigger. That is especially true for shared libraries.
I am enclosing something I did a few years back.
--
H.J. Lu (hjl@gnu.org)
----
Sat Sep 24 14:01:37 1994 H.J. Lu (hlu@fudan)
[ Note: Rick suggested we not use -fomit-frame-pointer. But according
to my measurement, -fomit-frame-pointer can speed up the
ELF/PIC library by as much as 6.5%. As a compromise, we use it
for ELF/PIC shared libraries only :-).
My ELF/PIC measurements:
gcc 2.6.0-940917 configured as i486-linuxelf and linked with
the ELF/PIC version of the Linux C 4.6.10. The assembler
is linked with the ELF/PIC version of the Linux C 4.6.10 as
well as the ELF/PIC version of libbfd. I compiled 170 C source
files.
1. -fPIC -O1 -funroll-loops -fomit-frame-pointer.
527.53user 505.47system 18:54.89elapsed 91%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps
2. -fPIC -O2 -funroll-loops -fomit-frame-pointer.
624.18user 537.69system 19:41.01elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps
3. -fPIC -O6
1152.32user 646.07system 30:23.42elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps
4. -fPIC -O6 -funroll-loops -fomit-frame-pointer.
1077.42user 604.54system 28:29.59elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps
FYI, -fPIC -O6 is only less than 5% slower than the old
a.out/DLL library. With -fomit-frame-pointer, they are
even.
I think the ELF/PIC library can be further fine tuned. H.J. ]