https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119920
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Created attachment 61814 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61814&action=edit 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.