https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78851

--- Comment #4 from Vadim Zeitlin <vz-gcc at zeitlins dot org> ---
Thanks for the explanation! I didn't realize the template function below was
smart enough to select __builtin_powil() automatically, this is quite
impressive (although it doesn't happen in my particular case...). Also, I
thought the comment was temporary because of the question in it: "What should
the return type of pow(float,int) be?", which seemed to require an answer
("double"), but maybe it's just a figure of style I didn't understand.

In practice, I definitely do not want to use -ffast-math (if anything, I'd
rather use -fexcess-precision=standard but it's, unfortunately, not available
for C++). And I can't change my (well, MinGW-w64's) libm. So, again, in this
particular case, if I understand you correctly, it seems like I simply will
have to live with the (very small, admittedly) loss of precision after
migrating the existing code base from C++98 to C++11, right?

And, to finish, yes, I did see the calculation being inlined when using
-fwhole-program or -flto (although the "assembly" output of the latter is a bit
more difficult to examine) and it happened even in much less trivial examples
and I was duly impressed by it (no kidding). However it still doesn't (and
can't) happen in my real code which is a bit more complicated.

Reply via email to