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 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


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