freebsd.h (CPP_CPU64_DEFAULT_SPEC): Replace with...
[gcc.git] / gcc / config / crx / crx.c
index 5fc963a6ce0022b03a032305c4ccde3a1efd084c..8f635d5a171e1516727d1f5c9155835c39dd0c7d 100644 (file)
@@ -44,7 +44,6 @@
 #include "expr.h"
 #include "optabs.h"
 #include "diagnostic-core.h"
-#include "toplev.h"
 #include "basic-block.h"
 #include "df.h"
 #include "target.h"
@@ -184,8 +183,8 @@ static void crx_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
 
 static const struct attribute_spec crx_attribute_table[] = {
   /* ISRs have special prologue and epilogue requirements. */
-  {"interrupt", 0, 0, false, true, true, NULL},
-  {NULL, 0, 0, false, false, false, NULL}
+  {"interrupt", 0, 0, false, true, true, NULL, false},
+  {NULL, 0, 0, false, false, false, NULL, false}
 };
 
 /* Option handling.  */
@@ -590,30 +589,21 @@ crx_function_arg_regno_p (int n)
  * Scaled index                --> reg + reg | 22-bit disp. + reg + reg |
  *                         22-disp. + reg + reg + (2 | 4 | 8) */
 
-static int crx_addr_reg_p (rtx addr_reg)
+static rtx
+crx_addr_reg (rtx addr_reg)
 {
-  rtx reg;
+  if (GET_MODE (addr_reg) != Pmode)
+    return NULL_RTX;
 
   if (REG_P (addr_reg))
-    {
-      reg = addr_reg;
-    }
-  else if ((GET_CODE (addr_reg) == SUBREG
+    return addr_reg;
+  else if (GET_CODE (addr_reg) == SUBREG
           && REG_P (SUBREG_REG (addr_reg))
-          && GET_MODE_SIZE (GET_MODE (SUBREG_REG (addr_reg)))
-          <= UNITS_PER_WORD))
-    {
-      reg = SUBREG_REG (addr_reg);
-    }
+          && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (addr_reg)))
+              <= UNITS_PER_WORD))
+    return SUBREG_REG (addr_reg);
   else
-    return FALSE;
-
-  if (GET_MODE (addr_reg) != Pmode)
-    {
-      return FALSE;
-    }
-
-  return TRUE;
+    return NULL_RTX;
 }
 
 enum crx_addrtype
@@ -752,8 +742,18 @@ crx_decompose_address (rtx addr, struct crx_address *out)
       return CRX_INVALID;
     }
 
-  if (base && !crx_addr_reg_p (base)) return CRX_INVALID;
-  if (index && !crx_addr_reg_p (index)) return CRX_INVALID;
+  if (base)
+    {
+      base = crx_addr_reg (base);
+      if (!base)
+       return CRX_INVALID;
+    }
+  if (index)
+    {
+      index = crx_addr_reg (index);
+      if (!index)
+       return CRX_INVALID;
+    }
   
   out->base = base;
   out->index = index;
@@ -1439,17 +1439,12 @@ crx_expand_prologue (void)
 void
 crx_expand_epilogue (void)
 {
-  rtx return_reg;
-
   /* Nonzero if we need to return and pop only RA. This will generate a
    * different insn. This differentiate is for the peepholes for call as last
    * statement in function. */
   int only_popret_RA = (save_regs[RETURN_ADDRESS_REGNUM]
                        && (sum_regs == UNITS_PER_WORD));
 
-  /* Return register.  */
-  return_reg = gen_rtx_REG (Pmode, RETURN_ADDRESS_REGNUM);
-
   if (frame_pointer_needed)
     /* Restore the stack pointer with the frame pointers value */
     emit_move_insn (stack_pointer_rtx, frame_pointer_rtx);