https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88842
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed| |2019-01-15 Component|other |tree-optimization Ever confirmed|0 |1 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- void foo(int a, int b, int c, int d, int e, int *res) { res[0] = (e * a) * d; res[1] = (e * b) * d; res[2] = (e * c) * d; } associating (e * d) allows CSE. Only possible when there's no overflow (-fwrapv or unsigned types). The issue is that reassoc is a "local" optimization, associating single chains rather than looking at multiple chains at once. And of course reassoc isn't "integrated" with CSE.