svn commit: trunk/uClibc

psm at uclibc.org psm at uclibc.org
Thu Feb 23 09:17:49 UTC 2006


Author: psm
Date: 2006-02-23 01:17:48 -0800 (Thu, 23 Feb 2006)
New Revision: 14230

Log:
Move -Os/-O2 first, add some gcc4 specific optimizations

Modified:
   trunk/uClibc/Rules.mak


Changeset:
Modified: trunk/uClibc/Rules.mak
===================================================================
--- trunk/uClibc/Rules.mak	2006-02-23 09:08:21 UTC (rev 14229)
+++ trunk/uClibc/Rules.mak	2006-02-23 09:17:48 UTC (rev 14230)
@@ -121,6 +121,24 @@
 ARFLAGS:=cr
 
 OPTIMIZATION:=
+# Use '-Os' optimization if available, else use -O2, allow Config to override
+OPTIMIZATION+=$(call check_gcc,-Os,-O2)
+# Use the gcc 3.4 -funit-at-a-time optimization when available
+OPTIMIZATION+=$(call check_gcc,-funit-at-a-time,)
+
+GCC_MAJOR_VER?=$(shell $(CC) -dumpversion | cut -d . -f 1)
+#GCC_MINOR_VER?=$(shell $(CC) -dumpversion | cut -d . -f 2)
+
+ifeq ($(GCC_MAJOR_VER),4)
+# shrinks code, results are from 4.0.2
+# 0.36%
+OPTIMIZATION+=$(call check_gcc,-fno-tree-loop-optimize,)
+# 0.34%
+OPTIMIZATION+=$(call check_gcc,-fno-tree-dominator-opts,)
+# 0.1%
+OPTIMIZATION+=$(call check_gcc,-fno-strength-reduce,)
+endif
+
 PICFLAG:=-fPIC
 PIEFLAG_NAME:=-fPIE
 
@@ -285,11 +303,6 @@
 endif
 endif
 
-# Use '-Os' optimization if available, else use -O2, allow Config to override
-OPTIMIZATION+=$(call check_gcc,-Os,-O2)
-# Use the gcc 3.4 -funit-at-a-time optimization when available
-OPTIMIZATION+=$(call check_gcc,-funit-at-a-time,)
-
 # Add a bunch of extra pedantic annoyingly strict checks
 XWARNINGS=$(subst ",, $(strip $(WARNINGS))) -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
 ifeq ($(EXTRA_WARNINGS),y)
@@ -372,8 +385,7 @@
 # gcc-3.4.x supports it, but does not need and support --combine. though fails on many sources
 # gcc-4.0.x supports it, supports the --combine flag, but does not need it
 # gcc-4.1(200506xx) supports it, but needs the --combine flag, else libs are useless
-GCC_VER?=$(shell $(CC) -dumpversion | cut -d . -f 1)
-ifeq ($(GCC_VER),3)
+ifeq ($(GCC_MAJOR_VER),3)
 DOMULTI:=n
 else
 CFLAGS+=$(call check_gcc,--combine,)




More information about the uClibc-cvs mailing list