]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
regclass.c (record_address_regs): Look at REG_OK_FOR_{BASE,INDEX}_P for hard regs...
authorChristian Iseli <Christian.Iseli@lslsun.epfl.ch>
Fri, 17 Oct 1997 15:46:57 +0000 (17:46 +0200)
committerJeff Law <law@gcc.gnu.org>
Fri, 17 Oct 1997 15:46:57 +0000 (09:46 -0600)
        * regclass.c (record_address_regs): Look at REG_OK_FOR_{BASE,INDEX}_P
        for hard regs to determine base and index registers.

From-SVN: r15954

gcc/ChangeLog
gcc/regclass.c

index 3b2cc6bd3e0020b77ebdb989f41b09bc159a47f8..8d6ca261aee8326e16e0ecd512e006186a915a37 100644 (file)
@@ -1,5 +1,8 @@
 Fri Oct 17 12:29:48 1997  Christian Iseli  <Christian.Iseli@lslsun.epfl.ch>
 
+       * regclass.c (record_address_regs): Look at REG_OK_FOR_{BASE,INDEX}_P
+       for hard regs to determine base and index registers.
+
        * reload.c (debug_reload_to_stream): New function.  Specify stream
        into which to write debug info.
        (debug_reload): Modify to call debug_reload_to_stream with stderr.
index 2932db138100ff29dfe0a4a4624700c5d6990cb5..45ee16ee20289e0d6d1b24a124a69e12b5780727 100644 (file)
@@ -1539,6 +1539,32 @@ record_address_regs (x, class, scale)
        else if (code1 == SYMBOL_REF || code1 == CONST || code1 == LABEL_REF)
          record_address_regs (arg0, INDEX_REG_CLASS, scale);
 
+       /* Look for the sum of two registers where the first is definitely
+          a base register or the second is definitely an index register. */
+
+       else if (code0 == REG && code1 == REG
+                && ((REGNO (arg0) < FIRST_PSEUDO_REGISTER 
+                     && REG_OK_FOR_BASE_P (arg0))
+                    || ((REGNO (arg1) < FIRST_PSEUDO_REGISTER 
+                         && REG_OK_FOR_INDEX_P (arg1)))))
+         {
+           record_address_regs (arg0, BASE_REG_CLASS, scale);
+           record_address_regs (arg1, INDEX_REG_CLASS, scale);
+         }
+
+       /* Look for the sum of two registers where the first is definitely
+          an index register or the second is definitely a base register. */
+
+       else if (code0 == REG && code1 == REG
+                && ((REGNO (arg1) < FIRST_PSEUDO_REGISTER 
+                     && REG_OK_FOR_BASE_P (arg1))
+                    || ((REGNO (arg0) < FIRST_PSEUDO_REGISTER 
+                         && REG_OK_FOR_INDEX_P (arg0)))))
+         {
+           record_address_regs (arg0, INDEX_REG_CLASS, scale);
+           record_address_regs (arg1, BASE_REG_CLASS, scale);
+         }
+
        /* If this the sum of two registers where the first is known to be a 
           pointer, it must be a base register with the second an index.  */