Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758154AbZALXU5 (ORCPT ); Mon, 12 Jan 2009 18:20:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755674AbZALXUl (ORCPT ); Mon, 12 Jan 2009 18:20:41 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:41115 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752136AbZALXUk (ORCPT ); Mon, 12 Jan 2009 18:20:40 -0500 Date: Mon, 12 Jan 2009 15:19:12 -0800 (PST) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Jamie Lokier cc: "H. Peter Anvin" , Andi Kleen , 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 Subject: Re: gcc inlining heuristics was Re: [PATCH -v7][RFC]: mutex: implement adaptive spinning In-Reply-To: <20090112230117.GC26430@shareable.org> Message-ID: References: <20090112001255.GR26290@one.firstfloor.org> <20090112005228.GS26290@one.firstfloor.org> <496B86B5.3090707@t-online.de> <20090112193201.GA23848@one.firstfloor.org> <496B9890.1090002@zytor.com> <20090112230117.GC26430@shareable.org> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1128 Lines: 29 On Mon, 12 Jan 2009, Jamie Lokier wrote: > > Sometimes code motion makes code faster and/or smaller but use more > stack space. If you want to keep the stack use down, it blocks some > other optimisations. Uhh. Yes. Compiling is an exercise in trade-offs. That doesn't mean that you should try to find the STUPID trade-offs, though. The thing is, there is no excuse for gcc's stupid alias analysis. Other compilers actually take advantage of things like the C standards type alias ambiguity by (a) realizing that it's insane as a general thing and (b) limiting it to the real special cases, like assuming that pointers to floats and pointers to integers do not alias. That, btw, is where the whole concept comes from. It should be passed off as an "unsafe FP optimization", where it actually makes sense, exactly like a lot of other unsafe FP optimizations. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/