-O2 optimization
David O'Brien
obrien at freebsd.org
Mon Sep 11 09:32:20 PDT 2006
I've been wondering. Since most ARM platforms are RAM and storage
limited, should we not compile with -O2 and use -Os instead.
-Os is "Optimize for size. -Os enables all -O2 optimizations that do not
typically increase code size. It also performs further optimizations
designed to reduce code size".
So what do folks think about this patch?
Index: kern.pre.mk
===================================================================
RCS file: /home/ncvs/src/sys/conf/kern.pre.mk,v
retrieving revision 1.76
diff -u -p -r1.76 kern.pre.mk
--- kern.pre.mk 17 Jul 2006 18:43:16 -0000 1.76
+++ kern.pre.mk 11 Sep 2006 16:29:47 -0000
@@ -27,7 +27,11 @@ COPTFLAGS?= -O
. if defined(DEBUG)
_MINUS_O= -O
. else
+. if ${MACHINE_ARCH} == "arm"
+_MINUS_O= -Os
+. else
_MINUS_O= -O2
+. endif
. endif
. if ${MACHINE_ARCH} == "amd64"
COPTFLAGS?=-O2 -frename-registers -pipe
--
-- David (obrien at FreeBSD.org)
Q: Because it reverses the logical flow of conversation.
A: Why is top-posting (putting a reply at the top of the message) frowned upon?
More information about the freebsd-arm
mailing list