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: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Dec 2003 19:26:30 -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 gdr at integrable-solutions dot net 2003-12-06 19:26 -------
Subject: Re: std::pow(T, int) implementation pessimizes code
"rguenth at tat dot physik dot uni-tuebingen dot de" <gcc-bugzilla@gcc.gnu.org> writes:
| Inlining __cmath_power won't help, as gcc is unable to optimize the loop
| in it which has a non-linear biv. Some time ago it did help to call
| __builtin_pow() from inside the integer overloads of pow, but I suspect
| this is no longer true. Another possibility is to use __builtin_constant()
| to check for constant exponent and manually optimize for this.
Just a note. I'm *for* a good approach that makes the situation better.
I excluse any use of __builtin_constant from any such approach.
| Btw., the ::pow() behavior is now a regression towards gcc 3.3
You should probably fill a separate PR for that,
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11706