]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR rtl-optimization/12441 (Can't spill register bug)
authorMatthias Klose <doko@debian.org>
Mon, 12 Jan 2004 09:02:27 +0000 (09:02 +0000)
committerMatthias Klose <doko@gcc.gnu.org>
Mon, 12 Jan 2004 09:02:27 +0000 (09:02 +0000)
2004-01-12  Matthias Klose  <doko@debian.org>

        Backport from mainline

        2004-01-11  Richard Henderson  <rth@redhat.com>
        PR opt/12441
        Revert: Sat Mar 30 14:08:55 CET 2002  Jan Hubicka  <jh@suse.cz>
        * i386.c (aligned_operand): Be prepared for SUBREGed registers.
        (ix86_decompose_address): Use REG_P instead of GET_CODE (...) == REG.
        (ix86_address_cost): Be prepared for SUBREGed registers.
        (legitimate_address_p): Accept SUBREGed registers.

From-SVN: r75708

gcc/ChangeLog
gcc/config/i386/i386.c

index ef6f63e78c15f1c4230f8677b33c52b60a8c8dde..85568bc64622c7a64ca8972489a3a758e0973f67 100644 (file)
@@ -1,3 +1,15 @@
+2004-01-12  Matthias Klose  <doko@debian.org>
+
+       Backport from mainline
+
+       2004-01-11  Richard Henderson  <rth@redhat.com>
+       PR opt/12441
+       Revert: Sat Mar 30 14:08:55 CET 2002  Jan Hubicka  <jh@suse.cz>
+       * i386.c (aligned_operand): Be prepared for SUBREGed registers.
+       (ix86_decompose_address): Use REG_P instead of GET_CODE (...) == REG.
+       (ix86_address_cost): Be prepared for SUBREGed registers.
+       (legitimate_address_p): Accept SUBREGed registers.
+
 2004-01-11  Richard Henderson  <rth@redhat.com>
 
        * config/alpha/alpha.c (alpha_encode_section_info): Use 'I'
index 0b845cfd6d3cd7ad50e775d45ec6abb37adbb356..0661d0a59a3057de7a0643eb6e30db9a924cef77 100644 (file)
@@ -3925,11 +3925,6 @@ aligned_operand (op, mode)
   if (! ix86_decompose_address (op, &parts))
     abort ();
 
-  if (parts.base && GET_CODE (parts.base) == SUBREG)
-    parts.base = SUBREG_REG (parts.base);
-  if (parts.index && GET_CODE (parts.index) == SUBREG)
-    parts.index = SUBREG_REG (parts.index);
-
   /* Look for some component that isn't known to be aligned.  */
   if (parts.index)
     {
@@ -5000,7 +4995,7 @@ ix86_decompose_address (addr, out)
   rtx scale_rtx = NULL_RTX;
   int retval = 1;
 
-  if (REG_P (addr) || GET_CODE (addr) == SUBREG)
+  if (GET_CODE (addr) == REG || GET_CODE (addr) == SUBREG)
     base = addr;
   else if (GET_CODE (addr) == PLUS)
     {
@@ -5127,11 +5122,6 @@ ix86_address_cost (x)
   if (!ix86_decompose_address (x, &parts))
     abort ();
 
-  if (parts.base && GET_CODE (parts.base) == SUBREG)
-    parts.base = SUBREG_REG (parts.base);
-  if (parts.index && GET_CODE (parts.index) == SUBREG)
-    parts.index = SUBREG_REG (parts.index);
-
   /* More complex memory references are better.  */
   if (parts.disp && parts.disp != const0_rtx)
     cost--;
@@ -5504,15 +5494,9 @@ legitimate_address_p (mode, addr, strict)
 
   if (base)
     {
-      rtx reg;
       reason_rtx = base;
 
-      if (GET_CODE (base) == SUBREG)
-       reg = SUBREG_REG (base);
-      else
-       reg = base;
-
-      if (GET_CODE (reg) != REG)
+      if (GET_CODE (base) != REG)
        {
          reason = "base is not a register";
          goto report_error;
@@ -5524,8 +5508,8 @@ legitimate_address_p (mode, addr, strict)
          goto report_error;
        }
 
-      if ((strict && ! REG_OK_FOR_BASE_STRICT_P (reg))
-         || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (reg)))
+      if ((strict && ! REG_OK_FOR_BASE_STRICT_P (base))
+         || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (base)))
        {
          reason = "base is not valid";
          goto report_error;
@@ -5540,15 +5524,9 @@ legitimate_address_p (mode, addr, strict)
 
   if (index)
     {
-      rtx reg;
       reason_rtx = index;
 
-      if (GET_CODE (index) == SUBREG)
-       reg = SUBREG_REG (index);
-      else
-       reg = index;
-
-      if (GET_CODE (reg) != REG)
+      if (GET_CODE (index) != REG)
        {
          reason = "index is not a register";
          goto report_error;
@@ -5560,8 +5538,8 @@ legitimate_address_p (mode, addr, strict)
          goto report_error;
        }
 
-      if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (reg))
-         || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (reg)))
+      if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (index))
+         || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (index)))
        {
          reason = "index is not valid";
          goto report_error;