Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Sep 2006 09:32:18 -0700
From:      "David O'Brien" <obrien@freebsd.org>
To:        freebsd-arm@freebsd.org
Subject:   -O2 optimization
Message-ID:  <20060911163218.GA88778@dragon.NUXI.org>

next in thread | raw e-mail | index | archive | help
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@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?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060911163218.GA88778>