From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17261 invoked by alias); 30 Jul 2003 16:01:16 -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 17254 invoked from network); 30 Jul 2003 16:01:16 -0000 Received: from unknown (HELO ams005.ftl.affinity.com) (216.219.253.199) by sources.redhat.com with SMTP; 30 Jul 2003 16:01:16 -0000 Received: from coyotegulch.com ([68.200.44.160]) by ams.ftl.affinity.com with ESMTP id <218412-16515>; Wed, 30 Jul 2003 12:00:31 -0400 Message-ID: <3F27EB99.7090407@coyotegulch.com> Date: Wed, 30 Jul 2003 16:25:00 -0000 From: Scott Robert Ladd User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030714 Debian/1.4-2 X-Accept-Language: en MIME-Version: 1.0 To: Richard.Earnshaw@arm.com CC: Gabriel Dos Reis , Karel Gardas , Alexandre Oliva , Richard Guenther , gcc@gcc.gnu.org Subject: Re: std::pow implementation References: <200307301338.h6UDc2p19569@pc960.cambridge.arm.com> In-Reply-To: <200307301338.h6UDc2p19569@pc960.cambridge.arm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-07/txt/msg02209.txt.bz2 Richard Earnshaw wrote: > Profiling doesn't help if the answer comes back as "sometimes" > (function foo's use of bar is best inlined, function wibble's use of > bar is best not inlined). Inlining is an optimization; in all but the most obvious and trivial cases (e.g., simple assignments), it should be performed by a programmer *after* profiling, and not before. "Premature optimization is the root of all evil", according to Hoare and Knuth; in code reviews, I tend to grumble about people who insist on inlining and using cute tricks, when they haven't done any analysis as to how their choices affect code quality and performance. The programmer, not the compiler, has the responsibility to create an effective program. -- Scott Robert Ladd Coyote Gulch Productions (http://www.coyotegulch.com) Software Invention for High-Performance Computing