From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: gcc inlining heuristics was Re: [PATCH -v7][RFC]: mutex: implement adaptive spinning Date: Mon, 12 Jan 2009 20:32:01 +0100 Message-ID: <20090112193201.GA23848@one.firstfloor.org> References: <20090111201427.GP26290@one.firstfloor.org> <1231704939.25018.548.camel@macbook.infradead.org> <20090111203441.GQ26290@one.firstfloor.org> <20090112001255.GR26290@one.firstfloor.org> <20090112005228.GS26290@one.firstfloor.org> <496B86B5.3090707@t-online.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Bernd Schmidt , Andi Kleen , David Woodhouse , Andrew Morton , Ingo Molnar , Harvey Harrison , "H. Peter Anvin" , Chris Mason , Peter Zijlstra , Steven Rostedt , paulmck@linux.vnet.ibm.com, Gregory Haskins , Matthew Wilcox , Linux Kernel Mailing List , linux-fsdevel , linux-btrfs , Thomas Gleixner , Nick Piggin , Peter Morreale , Sven Dietrich , jh@suse.cz To: Linus Torvalds Return-path: In-Reply-To: List-ID: On Mon, Jan 12, 2009 at 11:02:17AM -0800, Linus Torvalds wrote: > > Something at the back of my mind said "aliasing". > > > > $ gcc linus.c -O2 -S ; grep subl linus.s > > subl $1624, %esp > > $ gcc linus.c -O2 -S -fno-strict-aliasing; grep subl linus.s > > subl $824, %esp > > > > That's with 4.3.2. > > Interesting. > > Nonsensical, but interesting. What I find nonsensical is that -fno-strict-aliasing generates better code here. Normally one would expect the compiler seeing more aliases with that option and then be more conservative regarding any sharing. But it seems to be the other way round here. -Andi -- ak@linux.intel.com -- Speaking for myself only.