This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]