https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90774
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed| |2019-06-07 Component|middle-end |tree-optimization Ever confirmed|0 |1 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- The veclower pass already does this but is appearantly confused by missed association: <bb 2> [local count: 1073741825]: _18 = k_17(D) / 2; _1 = {_18, _18, _18, _18}; _2 = _1 + num_19(D); _21 = p_20(D) * 6234; _3 = {_21, _21, _21, _21}; the + num_19(D) done early makes it a vector result early. Associating that in a different way would help. So as Andrew says this is a reassoc heuristic issue. Doing return num + (1 + k / 2 + p * 6234 + 75 * h + j / 3452 + 53 * w + x / 820 + 4 * u + y + 25 + 829 / 3 * (3452/3)); also does what you want this.