https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71842
Bug ID: 71842 Summary: Optimize FMA when some arguments are simple constants Product: gcc Version: 7.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: glisse at gcc dot gnu.org Target Milestone: --- #include <math.h> double f(double x, double y){ return fma(x, y, 0.); } double g(double x, double y){ return fma(0., x, y); } double h(double x){ return fma(3., 4., x); } Depending on compiler options, we could optimize those to x*y, y and 12.+x. fma(1,x,y) might also be x+y.