From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: gcc inlining heuristics was Re: [PATCH -v7][RFC]: mutex: implement adaptive spinning Date: Mon, 12 Jan 2009 11:22:56 -0800 Message-ID: <496B9890.1090002@zytor.com> 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> <20090112193201.GA23848@one.firstfloor.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Cc: Linus Torvalds , Bernd Schmidt , David Woodhouse , Andrew Morton , Ingo Molnar , Harvey Harrison , 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: Andi Kleen Return-path: In-Reply-To: <20090112193201.GA23848@one.firstfloor.org> List-ID: Andi Kleen wrote: > 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. For this to be convolved with aliasing *AT ALL* indicates this is done incorrectly. This is about storage allocation, not aliases. Storage allocation only depends on lifetime. -hpa