[Bug middle-end/64225] -funsafe-math-optimizations generates call to pow where multiply instruction would do

2014-12-09 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64225 Richard Biener rguenth at gcc dot gnu.org changed: What|Removed |Added CC||wschmidt at

[Bug middle-end/64225] -funsafe-math-optimizations generates call to pow where multiply instruction would do

2014-12-08 Thread bernie.ogden at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64225 --- Comment #1 from Bernard Ogden bernie.ogden at linaro dot org --- Created attachment 34218 -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34218action=edit -v output

[Bug middle-end/64225] -funsafe-math-optimizations generates call to pow where multiply instruction would do

2014-12-08 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64225 ktkachov at gcc dot gnu.org changed: What|Removed |Added CC||ktkachov at gcc dot gnu.org

[Bug middle-end/64225] -funsafe-math-optimizations generates call to pow where multiply instruction would do

2014-12-08 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64225 ktkachov at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug middle-end/64225] -funsafe-math-optimizations generates call to pow where multiply instruction would do

2014-12-08 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64225 --- Comment #4 from ktkachov at gcc dot gnu.org --- Add -fno-math-errno removes the call to pow. We've seen similar issues before with other math builtins. The problem is that the midend/frontend generates the pow call without remembering that by

[Bug middle-end/64225] -funsafe-math-optimizations generates call to pow where multiply instruction would do

2014-12-08 Thread jgreenhalgh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64225 --- Comment #5 from jgreenhalgh at gcc dot gnu.org --- I've seen similar behavior on an HPC benchmark I was looking at. The problem here is the interaction between fold-const.c, other passes, and -fmath-errno. Take this testcase: void foo

[Bug middle-end/64225] -funsafe-math-optimizations generates call to pow where multiply instruction would do

2014-12-08 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64225 --- Comment #6 from ktkachov at gcc dot gnu.org --- 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. */ So we should look at why is it not being expanded as such unless

[Bug middle-end/64225] -funsafe-math-optimizations generates call to pow where multiply instruction would do

2014-12-08 Thread ktkachov at gcc dot gnu.org
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

[Bug middle-end/64225] -funsafe-math-optimizations generates call to pow where multiply instruction would do

2014-12-08 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64225 --- Comment #8 from joseph at codesourcery dot com joseph at codesourcery dot com --- Expanding x * x (or any such multiplication) to a call to pow is inherently dubious because the semantics of multiplication never include clobbering errno,