This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: std::pow implementation
- From: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 29 Jul 2003 13:45:30 +0200 (CEST)
- Subject: Re: std::pow implementation
On 29 Jul 2003, Gabriel Dos Reis wrote:
> Richard Guenther <rguenth@tat.physik.uni-tuebingen.de> 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 <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/