From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6224 invoked by alias); 25 Feb 2003 06:45:25 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 6217 invoked from network); 25 Feb 2003 06:45:24 -0000 Received: from unknown (HELO smtp4.wanadoo.nl) (194.134.35.175) by 172.16.49.205 with SMTP; 25 Feb 2003 06:45:24 -0000 Received: from steven.lr-s.tudelft.nl (3eea14be.cable.wanadoo.nl [62.234.20.190]) by smtp4.wanadoo.nl (Postfix) with ESMTP id D049C3E5FA; Tue, 25 Feb 2003 07:45:23 +0100 (CET) Subject: Re: Inlining (was: GCC 3.3 release criteria) From: Steven Bosscher To: Matt Austern Cc: Andi Kleen , "Kaveh R. Ghazi" , gcc@gcc.gnu.org, Stuart Hastings In-Reply-To: <97FAC2CA-4858-11D7-94CF-00039390D9E0@apple.com> References: <97FAC2CA-4858-11D7-94CF-00039390D9E0@apple.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Tue, 25 Feb 2003 08:09:00 -0000 Message-Id: <1046155533.725.17.camel@steven> Mime-Version: 1.0 X-SW-Source: 2003-02/txt/msg01683.txt.bz2 Op di 25-02-2003, om 01:32 schreef Matt Austern: > As it happens, Apple may be able to contribute a patch that does what > you're looking for. We've got a local patch that adds a new command > line switch, -fobey-inline. The switch does exactly what you think: > the > compiler will inline every function that's marked 'inline' whenever it's > possible. (There are still cases where it's not possible, of course, > e.g. > if you mark a recursive function inline.) > > We definitely don't want -fobey-inline to be the default: usually it's > better for the compiler to treat the inline keyword as a hint, and to > use its own heuristics to decide when to accept the hint. But there are > cases, as you've found, when a flag like this is useful. The compiler may be able to make better inlining decisionsm, but it should IMHO never overrule the user. So if the user says "inline this" then the compiler should try really hard to do so, even if it thinks the resulting code is worse than without inlining. How about making "obey-inline" the default, with a flag to enable a warning that would make the compiler complain if it thinks the function shouldn't be inlined? > If Apple contributed the -fobey-inline patch, would people here be > interested in it? Yes. Greetz Steven