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 -fno-math-errno