This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Suggestion: Add -ffast-math to default BOOT_CFLAGS
- From: Kelley Cook <kcook34 at ford dot com>
- To: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Tue, 20 Jan 2004 15:24:21 -0500
- Subject: Suggestion: Add -ffast-math to default BOOT_CFLAGS
- Hop-count: 1
- Reply-to: Kelley Cook <kelleycook at yahoo dot com>
I just timed using the same compilier sources built with and without
BOOT_CFLAGS="-O2 -g -ffast-math" to time building Gerald's Testcase.
Repeated runs showed that the slowest version with -ffast-math was still
faster than the quickest version without. Below is posted a sorted
-ftime-report comparing the quickest results obtained from g++ built
with and without -ffast-math. A 2 percent speedup is nothing to sneeze at.
Note that I have not yet done a full all-languages and libraries
regression test. But if those results do not change, it would seem
prudent to build the compiler with -ffast-math. A one-liner patch to do
that is attached.
Also this patch does not propose to make '-ffast-math' the default
compiler option -- that would be another discussion. It is only about
whether or not to build gcc itself using -ffast-math.
BOOT_CFLAGS -O2 -g -O2 -g Delta
-ffast-math
life analysis 4.94 4.02 -0.92
name lookup 8.83 8.35 -0.48
CSE 5.36 5.11 -0.25
garbage collection 5.98 5.83 -0.15
register scan 0.74 0.60 -0.14
CSE 2 2.68 2.57 -0.11
expand 3.20 3.11 -0.09
combiner 1.57 1.49 -0.08
branch prediction 0.69 0.61 -0.08
jump 0.54 0.47 -0.07
life info update 1.55 1.51 -0.04
bypass jumps 0.13 0.09 -0.04
if-conversion 2 0.14 0.10 -0.04
peephole 2 0.27 0.23 -0.04
flow 2 0.18 0.14 -0.04
cfg construction 0.69 0.65 -0.04
flow analysis 0.09 0.06 -0.03
cfg cleanup 1.30 1.28 -0.02
global CSE 0.50 0.49 -0.01
reorder blocks 0.23 0.22 -0.01
final 1.01 1.00 -0.01
callgraph optimization 0.04 0.04 0.00
preprocessing 0.51 0.51 0.00
callgraph construction 0.29 0.30 0.01
trivially dead code 0.92 0.93 0.01
shorten branches 0.27 0.29 0.02
rename registers 0.30 0.32 0.02
regmove 1.00 1.03 0.03
scheduling 2 1.05 1.09 0.04
local alloc 0.95 1.01 0.06
alias analysis 1.11 1.18 0.07
varconst 0.11 0.18 0.07
global alloc 2.22 2.31 0.09
reload CSE regs 1.11 1.20 0.09
loop analysis 0.57 0.66 0.09
integration 4.95 5.05 0.10
parser 9.82 9.93 0.11
rebuild jump labels 0.28 0.39 0.11
if-conversion 0.19 0.33 0.14
rest of compilation 1.07 1.26 0.19
------- -------- --------
Total 67.38 65.94 -1.44
--- Makefile.in 2004-01-20 14:54:29.967564800 -0500
+++ ../../gcc-snapshot/gcc/Makefile.in 2004-01-16 12:57:37.523872000 -0500
@@ -136,7 +137,7 @@
TCFLAGS =
CFLAGS = -g
STAGE1_CFLAGS = -g @stage1_cflags@
-BOOT_CFLAGS = -g -O2 -ffast-math
+BOOT_CFLAGS = -g -O2
# Flags to determine code coverage. When coverage is disabled, this will
# contain the optimization flags, as you normally want code coverage