OSDN Git Service

* config/bfin/bfin.c (bfin_delegitimize_address): New.
authorjiez <jiez@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 31 May 2006 15:42:22 +0000 (15:42 +0000)
committerjiez <jiez@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 31 May 2006 15:42:22 +0000 (15:42 +0000)
(TARGET_DELEGITIMIZE_ADDRESS): Define.

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

gcc/ChangeLog
gcc/config/bfin/bfin.c

index 4b2fcea..fb4974c 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-31  Jie Zhang  <jie.zhang@analog.com>
+
+       * config/bfin/bfin.c (bfin_delegitimize_address): New.
+       (TARGET_DELEGITIMIZE_ADDRESS): Define.
+
 2006-05-31  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * Makefile.in (CATALOGS): Add po/ prefix.
index 5234bfd..288e327 100644 (file)
@@ -1030,6 +1030,25 @@ legitimize_address (rtx x ATTRIBUTE_UNUSED, rtx oldx ATTRIBUTE_UNUSED,
   return NULL_RTX;
 }
 
+static rtx
+bfin_delegitimize_address (rtx orig_x)
+{
+  rtx x = orig_x, y;
+
+  if (GET_CODE (x) != MEM)
+    return orig_x;
+
+  x = XEXP (x, 0);
+  if (GET_CODE (x) == PLUS
+      && GET_CODE (XEXP (x, 1)) == UNSPEC
+      && XINT (XEXP (x, 1), 1) == UNSPEC_MOVE_PIC
+      && GET_CODE (XEXP (x, 0)) == REG
+      && REGNO (XEXP (x, 0)) == PIC_OFFSET_TABLE_REGNUM)
+    return XVECEXP (XEXP (x, 1), 0, 0);
+
+  return orig_x;
+}
+
 /* This predicate is used to compute the length of a load/store insn.
    OP is a MEM rtx, we return nonzero if its addressing mode requires a
    32 bit instruction.  */
@@ -3643,4 +3662,7 @@ bfin_expand_builtin (tree exp, rtx target ATTRIBUTE_UNUSED,
 #undef TARGET_SECONDARY_RELOAD
 #define TARGET_SECONDARY_RELOAD bfin_secondary_reload
 
+#undef TARGET_DELEGITIMIZE_ADDRESS
+#define TARGET_DELEGITIMIZE_ADDRESS bfin_delegitimize_address
+
 struct gcc_target targetm = TARGET_INITIALIZER;