https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82621

--- Comment #5 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Author: segher
Date: Fri Nov 17 14:46:04 2017
New Revision: 254874

URL: https://gcc.gnu.org/viewcvs?rev=254874&root=gcc&view=rev
Log:
combine: Don't split insns if half is unused (PR82621)

If we have a PARALLEL of two SETs, and one half is unused, we currently
happily split that into two instructions (although the unused one is
useless).  Worse, as PR82621 shows, combine will happily merge this
insn into I3 even if some intervening insn sets the same register
again, which is wrong.

This fixes it by not splitting PARALLELs with REG_UNUSED notes.  It
all is handled fine by combine in that case: just the "single set
that is unused" case isn't handled properly.

This also results in better code: combine will now actually throw
away the unused SET.  (It still won't do that in an I3).


        PR rtl-optimization/82621
        * combine.c (try_combine): Do not split PARALLELs of two SETs if the
        dest of one of those SETs is unused.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/combine.c

Reply via email to