Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / config / vax / vax.c
index 4e704b6..53189a7 100644 (file)
@@ -1,7 +1,5 @@
 /* Subroutines for insn-output.c for VAX.
-   Copyright (C) 1987, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002,
-   2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 1987-2013 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -53,7 +51,7 @@ static void vax_init_libfuncs (void);
 static void vax_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
                                 HOST_WIDE_INT, tree);
 static int vax_address_cost_1 (rtx);
-static int vax_address_cost (rtx, bool);
+static int vax_address_cost (rtx, enum machine_mode, addr_space_t, bool);
 static bool vax_rtx_costs (rtx, int, int, int, int *, bool);
 static rtx vax_function_arg (cumulative_args_t, enum machine_mode,
                             const_tree, bool);
@@ -64,6 +62,7 @@ static rtx vax_builtin_setjmp_frame_value (void);
 static void vax_asm_trampoline_template (FILE *);
 static void vax_trampoline_init (rtx, tree, rtx);
 static int vax_return_pops_args (tree, tree, int);
+static bool vax_mode_dependent_address_p (const_rtx, addr_space_t);
 \f
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_ALIGNED_HI_OP
@@ -103,6 +102,8 @@ static int vax_return_pops_args (tree, tree, int);
 
 #undef TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_P vax_legitimate_address_p
+#undef TARGET_MODE_DEPENDENT_ADDRESS_P
+#define TARGET_MODE_DEPENDENT_ADDRESS_P vax_mode_dependent_address_p
 
 #undef TARGET_FRAME_POINTER_REQUIRED
 #define TARGET_FRAME_POINTER_REQUIRED hook_bool_void_true
@@ -138,7 +139,7 @@ vax_add_reg_cfa_offset (rtx insn, int offset, rtx src)
 {
   rtx x;
 
-  x = plus_constant (frame_pointer_rtx, offset);
+  x = plus_constant (Pmode, frame_pointer_rtx, offset);
   x = gen_rtx_MEM (SImode, x);
   x = gen_rtx_SET (VOIDmode, x, src);
   add_reg_note (insn, REG_CFA_OFFSET, x);
@@ -201,7 +202,7 @@ vax_expand_prologue (void)
      it will be processed first.  This is required to allow the other
      notes be interpreted properly.  */
   add_reg_note (insn, REG_CFA_DEF_CFA,
-               plus_constant (frame_pointer_rtx, offset));
+               plus_constant (Pmode, frame_pointer_rtx, offset));
 
   /* Allocate the local stack frame.  */
   size = get_frame_size ();
@@ -373,11 +374,13 @@ print_operand_address (FILE * file, rtx addr)
              if (offset)
                {
                  if (CONST_INT_P (offset))
-                   offset = plus_constant (XEXP (addr, 0), INTVAL (offset));
+                   offset = plus_constant (Pmode, XEXP (addr, 0),
+                                           INTVAL (offset));
                  else
                    {
                      gcc_assert (CONST_INT_P (XEXP (addr, 0)));
-                     offset = plus_constant (offset, INTVAL (XEXP (addr, 0)));
+                     offset = plus_constant (Pmode, offset,
+                                             INTVAL (XEXP (addr, 0)));
                    }
                }
              offset = XEXP (addr, 0);
@@ -402,11 +405,13 @@ print_operand_address (FILE * file, rtx addr)
              if (offset)
                {
                  if (CONST_INT_P (offset))
-                   offset = plus_constant (XEXP (addr, 1), INTVAL (offset));
+                   offset = plus_constant (Pmode, XEXP (addr, 1),
+                                           INTVAL (offset));
                  else
                    {
                      gcc_assert (CONST_INT_P (XEXP (addr, 1)));
-                     offset = plus_constant (offset, INTVAL (XEXP (addr, 1)));
+                     offset = plus_constant (Pmode, offset,
+                                             INTVAL (XEXP (addr, 1)));
                    }
                }
              offset = XEXP (addr, 1);
@@ -731,7 +736,9 @@ vax_address_cost_1 (rtx addr)
 }
 
 static int
-vax_address_cost (rtx x, bool speed ATTRIBUTE_UNUSED)
+vax_address_cost (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED,
+                 addr_space_t as ATTRIBUTE_UNUSED,
+                 bool speed ATTRIBUTE_UNUSED)
 {
   return (1 + (REG_P (x) ? 0 : vax_address_cost_1 (x)));
 }
@@ -1829,8 +1836,8 @@ vax_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
    increment being the length of the operand) and all indexed address depend
    thus (because the index scale factor is the length of the operand).  */
 
-bool
-vax_mode_dependent_address_p (rtx x)
+static bool
+vax_mode_dependent_address_p (const_rtx x, addr_space_t as ATTRIBUTE_UNUSED)
 {
   rtx xfoo0, xfoo1;
 
@@ -2108,7 +2115,7 @@ vax_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
   mem = adjust_address (m_tramp, SImode, 4);
   emit_move_insn (mem, cxt);
   mem = adjust_address (m_tramp, SImode, 11);
-  emit_move_insn (mem, plus_constant (fnaddr, 2));
+  emit_move_insn (mem, plus_constant (Pmode, fnaddr, 2));
   emit_insn (gen_sync_istream ());
 }