Hi!

In the PR we have a PARALLEL of a move and a compare (a "mr." instruction).
The compare is dead, so single_set on it returns just the move.  Then,
simple_move_p returns true; but the instruction does need reloads in this
case.  This patch solves this by making simple_move_p return false for
every multiple_sets instruction.

Bootstrapped and regression checked on powerpc64-linux (-m64,-m32).
Is this okay for trunk?


Segher


2016-08-12  Segher Boessenkool  <seg...@kernel.crashing.org>

        PR rtl-optimization/73650
        * lra-constraints.c (simple_move_p): If the insn is multiple_sets
        it is not a simple move.

---
 gcc/lra-constraints.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index 880eee0..a5dca86 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -3452,6 +3452,13 @@ simple_move_p (void)
   lra_assert (curr_insn_set != NULL_RTX);
   dest = SET_DEST (curr_insn_set);
   src = SET_SRC (curr_insn_set);
+
+  /* If the instruction has multiple sets we need to process it even if it
+     is single_set.  This can happen if one or more of the SETs are dead.
+     See PR73650.  */
+  if (multiple_sets (curr_insn))
+    return false;
+
   return ((dclass = get_op_class (dest)) != NO_REGS
          && (sclass = get_op_class (src)) != NO_REGS
          /* The backend guarantees that register moves of cost 2
-- 
1.9.3

Reply via email to