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: Tue, 20 Jan 2009 17:22:20 -0800 Message-ID: <497678CC.5060703@zytor.com> References: <496BBE27.2020206@t-online.de> <20090119001345.GA9880@elte.hu> <20090119062212.GC22584@wotan.suse.de> <20090120005124.GD16304@wotan.suse.de> <20090120123824.GD7790@elte.hu> <1232480940.22233.1435.camel@macbook.infradead.org> <20090120210515.GC19710@elte.hu> <20090120220516.GA10483@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Cc: Linus Torvalds , David Woodhouse , Nick Piggin , Bernd Schmidt , Andi Kleen , Andrew Morton , 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 , Peter Morreale , Sven Dietrich , jh@suse.cz To: Ingo Molnar Return-path: In-Reply-To: <20090120220516.GA10483@elte.hu> List-ID: Ingo Molnar wrote: > > Hm, GCC uses __restrict__, right? > > I'm wondering whether there's any internal tie-up between alias analysis > and the __restrict__ keyword - so if we turn off aliasing optimizations > the __restrict__ keyword's optimizations are turned off as well. > Actually I suspect that "restrict" makes little difference for inlines or even statics, since gcc generally can do alias analysis fine there. However, in the presence of an intermodule function call, all alias analysis is off. This is presumably why type-based analysis is used at all ... to at least be able to a modicum of, say, loop invariant removal in the presence of a library call. This is also where "restrict" comes into play. -hpa