This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/11706] std::pow(T, int) implementation pessimizes code
- From: "rguenth at tat dot physik dot uni-tuebingen dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Dec 2003 20:05:33 -0000
- Subject: [Bug libstdc++/11706] std::pow(T, int) implementation pessimizes code
- References: <20030729120327.11706.rguenth@tat.physik.uni-tuebingen.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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