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 middle-end/64225] -funsafe-math-optimizations generates call to pow where multiply instruction would do


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

--- Comment #7 from ktkachov at gcc dot gnu.org ---
(In reply to ktkachov from comment #6)
> fold-const.c has a comment in the relevant case that says:
>  /* Canonicalize x*x as pow(x,2.0), which is expanded as x*x.  */

I think this comment is misleading.
In builtins.c the expand_builtin_mathfn_2 handles the expansion of pow and I
don't see any code to expand pow (x, 2.0) as x * x. It tries to use the pow
optab, so unless the backend explicitly expands the case in such a manner, it
will not be converted to x*x.

Is there some other place in the compiler that plays a role here?


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