This is the mail archive of the gcc-bugs@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]

[Bug libstdc++/11706] std::pow(T, int) implementation pessimizes code


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2003-12-06 20:05 -------
Subject: Re:  std::pow(T, int) implementation pessimizes
 code

On Sat, 5 Dec 2003, bkoz at gcc dot gnu dot org wrote:

> Can we get this resolved, folks? I think all that needs to be done now is
> examine cmath.tcc for inline-ability (ie, is __cmath_power to be inlined now?)
> Please let me know how I can help.

Ok, so I checked todays mainline and g++-3.3 (GCC) 3.3.3 20031114
(prerelease), with gcc 3.3, for both, ::pow(x,2) and std::pow(x,2) we
generate a call to libm, for mainline this is the same - except if we
compile with -ffast-math, in which case the first call is expanded to
optimal asm. So it seems this transformation is guarded with
-funsafe-math-optimizations -- why?

Richard.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11706


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