From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5313 invoked by alias); 29 Jul 2003 11:45:34 -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 5301 invoked from network); 29 Jul 2003 11:45:32 -0000 Received: from unknown (HELO mx01.uni-tuebingen.de) (134.2.3.11) by sources.redhat.com with SMTP; 29 Jul 2003 11:45:32 -0000 Received: from bellatrix.tat.physik.uni-tuebingen.de (bellatrix.tat.physik.uni-tuebingen.de [134.2.170.113]) by mx01.uni-tuebingen.de (8.12.3/8.12.3) with ESMTP id h6TBjV3a009879; Tue, 29 Jul 2003 13:45:31 +0200 Received: from bellatrix.tat.physik.uni-tuebingen.de (localhost [127.0.0.1]) by bellatrix.tat.physik.uni-tuebingen.de (8.12.3/8.12.2/SuSE Linux 0.6) with ESMTP id h6TBjUKA013074; Tue, 29 Jul 2003 13:45:30 +0200 Received: from localhost (rguenth@localhost) by bellatrix.tat.physik.uni-tuebingen.de (8.12.3/8.12.3/Submit) with ESMTP id h6TBjUpG013071; Tue, 29 Jul 2003 13:45:30 +0200 X-Authentication-Warning: bellatrix.tat.physik.uni-tuebingen.de: rguenth owned process doing -bs Date: Tue, 29 Jul 2003 12:10:00 -0000 From: Richard Guenther To: Gabriel Dos Reis cc: gcc@gcc.gnu.org Subject: Re: std::pow implementation In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-AntiVirus: checked by AntiVir Milter 1.0.2; AVE 6.20.0.1; VDF 6.20.0.50 X-SW-Source: 2003-07/txt/msg01961.txt.bz2 On 29 Jul 2003, Gabriel Dos Reis wrote: > Richard Guenther writes: > > | Can such be done for 3.4 and possibly 3.3, too? > > This is mainly an inlining problem with the compiler. Please fix the > compiler, don't obfuscate the library. cmath.tcc:std::__cmath_power is not even declared inline. So how do you expect the compiler to optimize the very common std::pow(x, 2) without -O3? And even with -O3 I cannot get gcc to optimize the simple double foo(double x) { std::pow(x, 2); } to something avoiding the call to std::__cmath_power. And I dont expect inlining heuristics to consider constant arguments even for tree-ssa in 3.5 timeframe. Richard. -- Richard Guenther WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/