WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Re: [PATCH] clean up CFLAGS

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [PATCH] clean up CFLAGS
From: Andi Kleen <ak@xxxxxxx>
Date: Fri, 10 Mar 2006 09:30:56 +0100
Cc: Charles Coffing <ccoffing@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 10 Mar 2006 16:02:55 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <21c4557e069fe8e3330fcfffcb94b073@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <441022BC.D169.003C.0@xxxxxxxxxx> <p73slpquzfr.fsf@xxxxxxxxxxxxx> <21c4557e069fe8e3330fcfffcb94b073@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.1
On Friday 10 March 2006 15:58, Keir Fraser wrote:
> 
> On 10 Mar 2006, at 14:50, Andi Kleen wrote:
> 
> >> I've put some default CFLAGS (-Wall -O3)
> >
> > Are you sure -O3 is a good idea? In my experience it just bloats
> > .text for most projects because of its aggressive inlining. I would
> > use -O2.
> 
> That's a good question. All that patch really did was move the 
> optimisation default into Config.mk, and the general choice throughout 
> the Xen tree was -O3. But it isn't clear that's best.

The main linux kernel switched to -Os by default now. Rationale
is that for kernel code it's best to be as small in icache as possible
and the optimizations in -O2 mostly help loops etc which kernel
code doesn't tend to do a whole lot of. 

Drawback is that it used to trigger some gcc code generation books,
but at least now it seems to be ok (i'm not aware of any current issues)

On x86-64 I'm also using -fno-reorder-blocks. The main reason is that
it also makes the code a bit smaller and more important it's much easier
to read the assembly code during debugging because it matches the C code 
better.

-Andi

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel