]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[AArch64] Fix preferred_reload_class for regclass STACK_REG.
authorMarcus Shawcroft <marcus.shawcroft@arm.com>
Thu, 17 Oct 2013 16:31:47 +0000 (16:31 +0000)
committerMarcus Shawcroft <mshawcroft@gcc.gnu.org>
Thu, 17 Oct 2013 16:31:47 +0000 (16:31 +0000)
From-SVN: r203778

gcc/ChangeLog
gcc/config/aarch64/aarch64.c

index 5a8fb7f2242e3a20e0173d285e919644536274b1..5630a191d4f84f333d74786d1fdb82627fa386bd 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-17  Marcus Shawcroft  <marcus.shawcroft@arm.com>
+
+       * config/aarch64/aarch64.c (aarch64_preferred_reload_class): Adjust
+       handling of STACK_REG.
+
 2013-10-17  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/58143
index da3962f354b3f85edafcb55a40fd7d3525036e57..7fce7a0506520a857450ab71e398a17f41b87a50 100644 (file)
@@ -4219,9 +4219,18 @@ aarch64_class_max_nregs (reg_class_t regclass, enum machine_mode mode)
 static reg_class_t
 aarch64_preferred_reload_class (rtx x, reg_class_t regclass)
 {
-  if (regclass == POINTER_REGS || regclass == STACK_REG)
+  if (regclass == POINTER_REGS)
     return GENERAL_REGS;
 
+  if (regclass == STACK_REG)
+    {
+      if (REG_P(x)
+         && reg_class_subset_p (REGNO_REG_CLASS (REGNO (x)), POINTER_REGS))
+         return regclass;
+
+      return NO_REGS;
+    }
+
   /* If it's an integer immediate that MOVI can't handle, then
      FP_REGS is not an option, so we return NO_REGS instead.  */
   if (CONST_INT_P (x) && reg_class_subset_p (regclass, FP_REGS)