]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lra: A multiple_sets is not a simple_move_p (PR73650)
authorSegher Boessenkool <segher@kernel.crashing.org>
Mon, 15 Aug 2016 16:17:21 +0000 (18:17 +0200)
committerSegher Boessenkool <segher@gcc.gnu.org>
Mon, 15 Aug 2016 16:17:21 +0000 (18:17 +0200)
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.

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

From-SVN: r239483

gcc/ChangeLog
gcc/lra-constraints.c

index dc7e8cbc451a7af37cb99c7dff51473ccffd4ccf..fa52700c953f8533624605360ee9e112f3afbd27 100644 (file)
@@ -1,3 +1,9 @@
+2016-08-15  Segher Boessenkool  <segher@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.
+
 2016-08-15  Martin Liska  <mliska@suse.cz>
 
        PR driver/72765
index 213e408c08b207949e0f50cfd718e29060591552..053a65aa404d90770791acc11265746a10fb5291 100644 (file)
@@ -3493,6 +3493,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