OSDN Git Service

PR target/36827
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Jul 2008 10:45:57 +0000 (10:45 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Jul 2008 10:45:57 +0000 (10:45 +0000)
* config/m32c/m32c.c (BIG_FB_ADJ): Move definition earlier.
(m32c_legitimate_address_p): Handle "++rii" addresses created by
m32c_legitimize_reload_address.

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

gcc/ChangeLog
gcc/config/m32c/m32c.c

index a6788fb..15e8205 100644 (file)
@@ -1,3 +1,10 @@
+2008-07-16  Joseph Myers  <joseph@codesourcery.com>
+
+       PR target/36827
+       * config/m32c/m32c.c (BIG_FB_ADJ): Move definition earlier.
+       (m32c_legitimate_address_p): Handle "++rii" addresses created by
+       m32c_legitimize_reload_address.
+
 2007-07-16  Rafael Avila de Espindola  <espindola@google.com>
 
        * c-decl.c (merge_decls): Keep DECL_SOURCE_LOCATION and
index b0733dd..ef6ba16 100644 (file)
@@ -1778,6 +1778,8 @@ m32c_init_libfuncs (void)
 
 /* Addressing Modes */
 
+#define BIG_FB_ADJ 0
+
 /* Used by GO_IF_LEGITIMATE_ADDRESS.  The r8c/m32c family supports a
    wide range of non-orthogonal addressing modes, including the
    ability to double-indirect on *some* of them.  Not all insns
@@ -1895,6 +1897,17 @@ m32c_legitimate_address_p (enum machine_mode mode, rtx x, int strict)
          return 0;
        }
     }
+  if (RTX_IS ("++rii"))
+    {
+      rtx reg = patternr[2];
+      HOST_WIDE_INT offs = INTVAL (patternr[3]);
+
+      /* Avoid reloads for addresses generated by
+        m32c_legitimize_reload_address being generated by
+        find_reloads_subreg_address.  */
+      if (REGNO (reg) == FB_REGNO && offs == -BIG_FB_ADJ)
+       return 1;
+    }
   return 0;
 }
 
@@ -1942,8 +1955,6 @@ m32c_reg_ok_for_base_p (rtx x, int strict)
    frame, so the third case seems best.  Note that we subtract the
    zero, but detect that in the addhi3 pattern.  */
 
-#define BIG_FB_ADJ 0
-
 /* Implements LEGITIMIZE_ADDRESS.  The only address we really have to
    worry about is frame base offsets, as $fb has a limited
    displacement range.  We deal with this by attempting to reload $fb