This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Different code with default and -finline-limit=600
- From: Scott Robert Ladd <coyote at coyotegulch dot com>
- To: gcc mailing list <gcc at gcc dot gnu dot org>
- Date: Tue, 28 Oct 2003 20:31:44 -0500
- Subject: Different code with default and -finline-limit=600
Yes, it's me again, with another GCC curiosity.
I'm testing with the current snapshot of gcc 3.4.
According to my reading of the documentation and examination of the gcc
source code, the default value of -finline-limit is 600.
Why, the, do the following two compile commands generate different
executable images?
gcc -std=gnu99 -lrt -DACOVEA -march=pentium4 -Darch_pentium4 \
-O1 -finline-functions -finline-limit=600 \
-o treebench-baseline-inline1 treebench.c
gcc -std=gnu99 -lrt -DACOVEA -march=pentium4 -Darch_pentium4 \
-O1 -finline-functions \
-o treebench-baseline-inline1 treebench.c
The first generates a program that is 15,797 bytes, while the second
generates 12,917 executable bytes. The two run at about the same
speed... HOWEVER, when I use the more complex command line:
gcc -std=gnu99 -lm -lrt -DACOVEA -march=pentium4 -Darch_pentium4 \
-O1 -fgcse -frerun-loop-opt -fstrict-aliasing \
-finline-functions -fmove-all-movables -fpeel-loops \
-ftracer -funsafe-math-optimizations -finline-limit=600 \
-o treebench-baseline-ga treebench.c
With -finline-limit=600, gcc generates a 16,693 byte program that runs
5% faster than the 13,349 byte executable generated without specifying a
limit.
The same phenomenon occurs on both Pentium 3 and 4 systems.
I note that this integer-only program benefits from
-funsafe-math-optimizations; I'll look at the assembly output in the
morning, once I've had some sleep. I'm a day or so away from publishing
my paper and code (I'm tabulating numbers at the moment); if anyone
wants to see treebench.c, let me know.
--
Scott Robert Ladd
Coyote Gulch Productions (http://www.coyotegulch.com)
Software Invention for High-Performance Computing