https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119920
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #6) > Created attachment 61814 [details] > First prototype > > Has some rough edges (extra dumps for quick debugging; it also does not > handle commutative operations yet so it might not detect everything). But it > looks like it works for this case. s/new_op.ops[0] = new_res;/new_op.ops[opnum] = new_res;/ That is needed to fix the patch; otherwise you get wrong code :). Noticed while testing the patch.