aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2009-09-23 15:24:42 -0700
committerRichard Henderson <rth@gcc.gnu.org>2009-09-23 15:24:42 -0700
commit2b4fa409a97f9d398698dff291e4e7176747d6b4 (patch)
tree321b9eb874c077b9b7674eb07850055b8825fc48 /gcc/config
parent9193312a099c192f134768d0567fb5d29107a796 (diff)
downloadgcc-2b4fa409a97f9d398698dff291e4e7176747d6b4.zip
gcc-2b4fa409a97f9d398698dff291e4e7176747d6b4.tar.gz
gcc-2b4fa409a97f9d398698dff291e4e7176747d6b4.tar.bz2
tm.texi (STATIC_CHAIN, [...]): Remove.
* doc/tm.texi (STATIC_CHAIN, STATIC_CHAIN_INCOMING): Remove. (TARGET_STATIC_CHAIN): Mention that this hook must be used for static chain passed in memory. * system.h (STATIC_CHAIN, STATIC_CHAIN_INCOMING): Poison. * targhooks.c (default_static_chain): Don't handle STATIC_CHAIN, STATIC_CHAIN_INCOMING. Issue a sorry if there's no STATIC_CHAIN_REGNUM defined. * config/picochip/picochip-protos.h: s/class/klass/. * config/picochip/picochip.c (TARGET_STATIC_CHAIN): New. (picochip_static_chain): New. * config/picochip/picochip.h (STATIC_CHAIN): Remove. (STATIC_CHAIN_INCOMING): Remove. * config/xtensa/xtensa.c (TARGET_STATIC_CHAIN): New. (xtensa_static_chain): New. * config/xtensa/xtensa.h (STATIC_CHAIN, STATIC_CHAIN_INCOMING): * Remove. From-SVN: r152104
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/picochip/picochip-protos.h2
-rw-r--r--gcc/config/picochip/picochip.c16
-rw-r--r--gcc/config/picochip/picochip.h14
-rw-r--r--gcc/config/xtensa/xtensa.c14
-rw-r--r--gcc/config/xtensa/xtensa.h11
5 files changed, 31 insertions, 26 deletions
diff --git a/gcc/config/picochip/picochip-protos.h b/gcc/config/picochip/picochip-protos.h
index 7a2a07b..de68c81 100644
--- a/gcc/config/picochip/picochip-protos.h
+++ b/gcc/config/picochip/picochip-protos.h
@@ -60,7 +60,7 @@ extern CUMULATIVE_ARGS picochip_arg_advance (CUMULATIVE_ARGS cum, int mode,
tree type, int named);
extern int picochip_regno_nregs (int regno, int mode);
-extern int picochip_class_max_nregs (int class, int mode);
+extern int picochip_class_max_nregs (int klass, int mode);
extern void picochip_order_regs_for_local_alloc (void);
diff --git a/gcc/config/picochip/picochip.c b/gcc/config/picochip/picochip.c
index 5155e76..bf6d263 100644
--- a/gcc/config/picochip/picochip.c
+++ b/gcc/config/picochip/picochip.c
@@ -111,6 +111,8 @@ picochip_asm_named_section (const char *name,
unsigned int flags ATTRIBUTE_UNUSED,
tree decl ATTRIBUTE_UNUSED);
+static rtx picochip_static_chain (const_tree, bool);
+
/* Lookup table mapping a register number to the earliest containing
class. Used by REGNO_REG_CLASS. */
const enum reg_class picochip_regno_reg_class[FIRST_PSEUDO_REGISTER] =
@@ -289,6 +291,9 @@ static char picochip_get_vliw_alu_id (void);
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY picochip_return_in_memory
+#undef TARGET_STATIC_CHAIN
+#define TARGET_STATIC_CHAIN picochip_static_chain
+
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -4402,3 +4407,14 @@ picochip_check_conditional_copy (rtx * operands)
}
+
+static rtx
+picochip_static_chain (const_tree ARG_UNUSED (fndecl), bool incoming_p)
+{
+ rtx addr;
+ if (incoming_p)
+ addr = arg_pointer_rtx;
+ else
+ addr = plus_constant (stack_pointer_rtx, -2 * UNITS_PER_WORD);
+ return gen_frame_mem (Pmode, addr);
+}
diff --git a/gcc/config/picochip/picochip.h b/gcc/config/picochip/picochip.h
index 35c66d2..44559f2 100644
--- a/gcc/config/picochip/picochip.h
+++ b/gcc/config/picochip/picochip.h
@@ -391,20 +391,6 @@ extern const enum reg_class picochip_regno_reg_class[FIRST_PSEUDO_REGISTER];
#define FRAME_POINTER_REGNUM 18
#define ARG_POINTER_REGNUM 19
-/* Static chain is used to pass the local variables of the enclosing function.
- The static chain is passed in memory. The first long-word location
- beneath the stack pointer is used. In the presence of pretend
- arguments, which are written into that location, this mechanism
- complicates matters. */
-
-/* Location seen by the caller. */
-#define STATIC_CHAIN \
- gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, -2 * UNITS_PER_WORD))
-
-/* Location seen by the callee. */
-#define STATIC_CHAIN_INCOMING \
- gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, 0))
-
/* Eliminating Frame Pointer and Arg Pointer. The frame and argument
pointers are eliminated wherever possible, by replacing them with
offsets from the stack pointer. */
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 0264868..f7b7374 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -146,6 +146,7 @@ static tree xtensa_fold_builtin (tree, tree, bool);
static rtx xtensa_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
static void xtensa_va_start (tree, rtx);
static bool xtensa_frame_pointer_required (void);
+static rtx xtensa_static_chain (const_tree, bool);
static void xtensa_asm_trampoline_template (FILE *);
static void xtensa_trampoline_init (rtx, tree, rtx);
@@ -231,6 +232,8 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
#undef TARGET_FRAME_POINTER_REQUIRED
#define TARGET_FRAME_POINTER_REQUIRED xtensa_frame_pointer_required
+#undef TARGET_STATIC_CHAIN
+#define TARGET_STATIC_CHAIN xtensa_static_chain
#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
#define TARGET_ASM_TRAMPOLINE_TEMPLATE xtensa_asm_trampoline_template
#undef TARGET_TRAMPOLINE_INIT
@@ -3434,6 +3437,17 @@ xtensa_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED,
outgoing ? GP_OUTGOING_RETURN : GP_RETURN);
}
+/* The static chain is passed in memory. Provide rtx giving 'mem'
+ expressions that denote where they are stored. */
+
+static rtx
+xtensa_static_chain (const_tree ARG_UNUSED (fndecl), bool incoming_p)
+{
+ rtx base = incoming_p ? arg_pointer_rtx : stack_pointer_rtx;
+ return gen_frame_mem (Pmode, plus_constant (base, -5 * UNITS_PER_WORD));
+}
+
+
/* TRAMPOLINE_TEMPLATE: For Xtensa, the trampoline must perform an ENTRY
instruction with a minimal stack frame in order to get some free
registers. Once the actual call target is known, the proper stack frame
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index 4fefbfd..b9d896a 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -383,17 +383,6 @@ extern char xtensa_hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER];
/* Base register for access to arguments of the function. */
#define ARG_POINTER_REGNUM (GP_REG_FIRST + 17)
-/* If the static chain is passed in memory, these macros provide rtx
- giving 'mem' expressions that denote where they are stored.
- 'STATIC_CHAIN' and 'STATIC_CHAIN_INCOMING' give the locations as
- seen by the calling and called functions, respectively. */
-
-#define STATIC_CHAIN \
- gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, -5 * UNITS_PER_WORD))
-
-#define STATIC_CHAIN_INCOMING \
- gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, -5 * UNITS_PER_WORD))
-
/* For now we don't try to use the full set of boolean registers. Without
software pipelining of FP operations, there's not much to gain and it's
a real pain to get them reloaded. */