https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83350
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed| |2017-12-11 CC| |rguenth at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- We're associating it a bit but we do not know of the power identities like (a + b)^2 = a*a + 2*a*b + b*b eventually undistribute_ops_list could be used to implement a generic variant as it already searches for a similar pattern to apply reverse distribution law a*a + a*b -> a * (a + b). Note that at some point of complexity I view such transforms as responsibility of the programmer rather than the compiler... (this one is on the border)