]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cris.md ("reload_out<mode>"): Mark operand 2 as earlyclobber.
authorHans-Peter Nilsson <hp@axis.com>
Fri, 25 Nov 2005 20:15:27 +0000 (20:15 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Fri, 25 Nov 2005 20:15:27 +0000 (20:15 +0000)
* config/cris/cris.md ("reload_out<mode>"): Mark operand 2 as
earlyclobber.
* targhooks.c (default_secondary_reload): Don't require operand 2
for an input reload to be earlyclobber.

From-SVN: r107517

gcc/ChangeLog
gcc/config/cris/cris.md
gcc/targhooks.c

index 580dd5339234a75f74afd57deebdc957711c7ecf..f26b24a24ce6a24bd5a29238aa564576b14449f2 100644 (file)
@@ -1,3 +1,10 @@
+2005-11-25  Hans-Peter Nilsson  <hp@axis.com>
+
+       * config/cris/cris.md ("reload_out<mode>"): Mark operand 2 as
+       earlyclobber.
+       * targhooks.c (default_secondary_reload): Don't require operand 2
+       for an input reload to be earlyclobber.
+
 2005-11-25  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        * fold-const.c (negate_mathfn_p): Fix comment and add support
index 37bd4ab1306b2832f75bb0a7bf79c5c51ba7a014..5665897ebf6e2ec305a5b7c83aaa1565353b8268 100644 (file)
   "")
 
 (define_expand "reload_out<mode>"
-  [(set (match_operand:BW 2 "register_operand" "=r")
+  [(set (match_operand:BW 2 "register_operand" "=&r")
        (match_operand:BW 1 "register_operand" "x"))
    (set (match_operand:BW 0 "memory_operand" "=m")
        (match_dup 2))]
index 1d5a7fec42cc682173b28e283feb5dba4e80d467..afeba1f3f641abe19033dc82192d922261cc64ac 100644 (file)
@@ -514,10 +514,15 @@ default_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x ATTRIBUTE_UNUSED,
            }
 
          scratch_constraint = insn_data[(int) icode].operand[2].constraint;
-         /* The scratch register's constraint must start with "=&".  */
+         /* The scratch register's constraint must start with "=&",
+            except for an input reload, where only "=" is necessary,
+            and where it might be beneficial to re-use registers from
+            the input.  */
          gcc_assert (scratch_constraint[0] == '='
-                     && scratch_constraint[1] == '&');
-         scratch_constraint += 2;
+                     && (in_p || scratch_constraint[1] == '&'));
+         scratch_constraint++;
+         if (*scratch_constraint == '&')
+           scratch_constraint++;
          scratch_letter = *scratch_constraint;
          scratch_class
            = (scratch_letter == 'r' ? GENERAL_REGS