lra: Don't remove the scratch in (mem:BLK (scratch))
authorsegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 29 Oct 2015 19:24:48 +0000 (19:24 +0000)
committersegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 29 Oct 2015 19:24:48 +0000 (19:24 +0000)
LRA wants to replace SCRATCH registers with real registers.  It should
not do that with (mem:BLK (scratch)), which is special, not really a
scratch register.

2015-10-29  Segher Boessenkool  <segher@kernel.crashing.org>

* lra-constraints.c (process_address_1): Handle (mem:BLK (scratch))
by ignoring it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229551 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/lra-constraints.c

index fa3e956..75ba2e8 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-29  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       * lra-constraints.c (process_address_1): Handle (mem:BLK (scratch))
+       by ignoring it.
+
 2015-10-29  Richard Henderson  <rth@redhat.com>
 
        PR target/68124
index 0f54b6c..c2777e9 100644 (file)
@@ -2874,6 +2874,11 @@ process_address_1 (int nop, bool check_only_p,
   enum constraint_num cn = lookup_constraint (constraint);
   bool change_p = false;
 
+  if (MEM_P (op)
+      && GET_MODE (op) == BLKmode
+      && GET_CODE (XEXP (op, 0)) == SCRATCH)
+    return false;
+
   if (insn_extra_address_constraint (cn))
     decompose_lea_address (&ad, curr_id->operand_loc[nop]);
   else if (MEM_P (op))