]> git.ipfire.org Git - thirdparty/gcc.git/commit
combine: Don't split insns if half is unused (PR82621)
authorSegher Boessenkool <segher@kernel.crashing.org>
Fri, 24 Nov 2017 17:03:04 +0000 (18:03 +0100)
committerSegher Boessenkool <segher@gcc.gnu.org>
Fri, 24 Nov 2017 17:03:04 +0000 (18:03 +0100)
commit269af9105524e4c5a8af43e3e4750c16f742a0db
treecd296613a1e600e03968282f7aacad2eb076db28
parent44a0038eb241a9f23c672cd094b4a3ba1681bbba
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 (albeit 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.

From-SVN: r255143
gcc/ChangeLog
gcc/combine.c