aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-10-28 20:19:57 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-10-28 20:19:57 +0000
commit73f3f8411f8eab303306829f4cb9a62c25129b6f (patch)
tree44ca92501fab5a4e930d4526332de599baa3c626 /gcc
parent3acf034c5a48c45c39a5be03369cea154fe39f25 (diff)
downloadgcc-73f3f8411f8eab303306829f4cb9a62c25129b6f.zip
gcc-73f3f8411f8eab303306829f4cb9a62c25129b6f.tar.gz
gcc-73f3f8411f8eab303306829f4cb9a62c25129b6f.tar.bz2
cris.h (FUNCTION_ARG, [...]): Delete.
* config/cris/cris.h (FUNCTION_ARG, FUNCTION_INCOMING_ARG): Delete. (FUNCTION_ARG_ADVANCE): Delete. * config/cris/cris.c (cris_function_arg_1, cris_function_arg): New functions. (cris_function_incoming_arg, cris_function_arg_advance): New functions. (TARGET_FUNCTION_ARG, TARGET_FUNCTION_INCOMING_ARG): Define. (TARGET_FUNCTION_ARG_ADVANCE): Define. From-SVN: r166045
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/cris/cris.c57
-rw-r--r--gcc/config/cris/cris.h18
3 files changed, 68 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4e87797..1dd0bd0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,16 @@
2010-10-28 Nathan Froyd <froydnj@codesourcery.com>
+ * config/cris/cris.h (FUNCTION_ARG, FUNCTION_INCOMING_ARG): Delete.
+ (FUNCTION_ARG_ADVANCE): Delete.
+ * config/cris/cris.c (cris_function_arg_1, cris_function_arg): New
+ functions.
+ (cris_function_incoming_arg, cris_function_arg_advance): New
+ functions.
+ (TARGET_FUNCTION_ARG, TARGET_FUNCTION_INCOMING_ARG): Define.
+ (TARGET_FUNCTION_ARG_ADVANCE): Define.
+
+2010-10-28 Nathan Froyd <froydnj@codesourcery.com>
+
* config/lm32/lm32-protos.h (lm32_function_arg): Delete.
* config/lm32/lm32.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
* config/mcore/mcore.c (mcore_function_arg): Declare. Make static.
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 11e3071..fd5e095 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -129,6 +129,12 @@ static bool cris_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
const_tree, bool);
static int cris_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
+static rtx cris_function_arg (CUMULATIVE_ARGS *, enum machine_mode,
+ const_tree, bool);
+static rtx cris_function_incoming_arg (CUMULATIVE_ARGS *,
+ enum machine_mode, const_tree, bool);
+static void cris_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
+ const_tree, bool);
static tree cris_md_asm_clobbers (tree, tree, tree);
static bool cris_handle_option (size_t, const char *, int);
@@ -214,6 +220,12 @@ static const struct default_options cris_option_optimization_table[] =
#define TARGET_PASS_BY_REFERENCE cris_pass_by_reference
#undef TARGET_ARG_PARTIAL_BYTES
#define TARGET_ARG_PARTIAL_BYTES cris_arg_partial_bytes
+#undef TARGET_FUNCTION_ARG
+#define TARGET_FUNCTION_ARG cris_function_arg
+#undef TARGET_FUNCTION_INCOMING_ARG
+#define TARGET_FUNCTION_INCOMING_ARG cris_function_incoming_arg
+#undef TARGET_FUNCTION_ARG_ADVANCE
+#define TARGET_FUNCTION_ARG_ADVANCE cris_function_arg_advance
#undef TARGET_MD_ASM_CLOBBERS
#define TARGET_MD_ASM_CLOBBERS cris_md_asm_clobbers
#undef TARGET_DEFAULT_TARGET_FLAGS
@@ -3891,6 +3903,51 @@ cris_arg_partial_bytes (CUMULATIVE_ARGS *ca, enum machine_mode mode,
return 0;
}
+static rtx
+cris_function_arg_1 (const CUMULATIVE_ARGS *ca,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ const_tree type ATTRIBUTE_UNUSED,
+ bool named, bool incoming)
+{
+ if ((!incoming || named) && ca->regs < CRIS_MAX_ARGS_IN_REGS)
+ return gen_rtx_REG (mode, CRIS_FIRST_ARG_REG + ca->regs);
+ else
+ return NULL_RTX;
+}
+
+/* Worker function for TARGET_FUNCTION_ARG.
+ The void_type_node is sent as a "closing" call. */
+
+static rtx
+cris_function_arg (CUMULATIVE_ARGS *ca, enum machine_mode mode,
+ const_tree type, bool named)
+{
+ return cris_function_arg_1 (ca, mode, type, named, false);
+}
+
+/* Worker function for TARGET_FUNCTION_INCOMING_ARG.
+
+ The differences between this and the previous, is that this one checks
+ that an argument is named, since incoming stdarg/varargs arguments are
+ pushed onto the stack, and we don't have to check against the "closing"
+ void_type_node TYPE parameter. */
+
+static rtx
+cris_function_incoming_arg (CUMULATIVE_ARGS *ca, enum machine_mode mode,
+ const_tree type, bool named)
+{
+ return cris_function_arg_1 (ca, mode, type, named, true);
+}
+
+/* Worker function for TARGET_FUNCTION_ARG_ADVANCE. */
+
+static void
+cris_function_arg_advance (CUMULATIVE_ARGS *ca, enum machine_mode mode,
+ const_tree type, bool named ATTRIBUTE_UNUSED)
+{
+ ca->regs += (3 + CRIS_FUNCTION_ARG_SIZE (mode, type)) / 4;
+}
+
/* Worker function for TARGET_MD_ASM_CLOBBERS. */
static tree
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index 090bcd1..776c44e 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -848,21 +848,6 @@ enum reg_class
/* Node: Register Arguments */
-/* The void_type_node is sent as a "closing" call. */
-#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
- ((CUM).regs < CRIS_MAX_ARGS_IN_REGS \
- ? gen_rtx_REG (MODE, (CRIS_FIRST_ARG_REG) + (CUM).regs) \
- : NULL_RTX)
-
-/* The differences between this and the previous, is that this one checks
- that an argument is named, since incoming stdarg/varargs arguments are
- pushed onto the stack, and we don't have to check against the "closing"
- void_type_node TYPE parameter. */
-#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
- ((NAMED) && (CUM).regs < CRIS_MAX_ARGS_IN_REGS \
- ? gen_rtx_REG (MODE, CRIS_FIRST_ARG_REG + (CUM).regs) \
- : NULL_RTX)
-
/* Contrary to what you'd believe, defining FUNCTION_ARG_CALLEE_COPIES
seems like a (small total) loss, at least for gcc-2.7.2 compiling and
running gcc-2.1 (small win in size, small loss running -- 100.1%),
@@ -880,9 +865,6 @@ struct cum_args {int regs;};
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
((CUM).regs = 0)
-#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
- ((CUM).regs += (3 + CRIS_FUNCTION_ARG_SIZE (MODE, TYPE)) / 4)
-
#define FUNCTION_ARG_REGNO_P(REGNO) \
((REGNO) >= CRIS_FIRST_ARG_REG \
&& (REGNO) < CRIS_FIRST_ARG_REG + (CRIS_MAX_ARGS_IN_REGS))