diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 757afc59cdf7..60c03f17d299 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2004-01-26 Kazu Hirata + + * config/arm/arm.c (TARGET_PROMOTE_FUNCTION_ARGS): New. + (TARGET_PROMOTE_PROTOTYPES): Likewise. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (arm_struct_value_rtx): Likewise. + * config/arm/arm.h (PROMOTE_FUNCTION_ARGS): Remove. + (STRUCT_VALUE): Likewise. + (STRUCT_VALUE_REGNUM): Likewise. + (PROMOTE_PROTOTYPES): Likewise. + 2004-01-26 Kazu Hirata * config/ia64/ia64-protos.h: Remove the prototype for diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 5e7bbe7753e7..692432b3bdf7 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -150,6 +150,7 @@ static void aof_dump_pic_table (FILE *); static void aof_file_start (void); static void aof_file_end (void); #endif +static rtx arm_struct_value_rtx (tree, int); /* Initialize the GCC target structure. */ @@ -233,6 +234,14 @@ static void aof_file_end (void); #undef TARGET_EXPAND_BUILTIN #define TARGET_EXPAND_BUILTIN arm_expand_builtin +#undef TARGET_PROMOTE_FUNCTION_ARGS +#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true +#undef TARGET_PROMOTE_PROTOTYPES +#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true + +#undef TARGET_STRUCT_VALUE_RTX +#define TARGET_STRUCT_VALUE_RTX arm_struct_value_rtx + struct gcc_target targetm = TARGET_INITIALIZER; /* Obstack for minipool constant handling. */ @@ -13322,3 +13331,22 @@ arm_output_load_gr (rtx *operands) return ""; } + +static rtx +arm_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED, + int incoming ATTRIBUTE_UNUSED) +{ +#if 0 + /* FIXME: The ARM backend has special code to handle structure + returns, and will reserve its own hidden first argument. So + if this macro is enabled a *second* hidden argument will be + reserved, which will break binary compatibility with old + toolchains and also thunk handling. One day this should be + fixed. */ + return 0; +#else + /* Register in which address to store a structure value + is passed to a function. */ + return gen_rtx_REG (Pmode, ARG_REGISTER (1)); +#endif +} diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 40c26c9b39dc..d169f180f817 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for ARM. Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) and Martin Simmons (@harleqn.co.uk). More major hacks by Richard Earnshaw (rearnsha@arm.com) @@ -709,11 +709,6 @@ extern int arm_is_6_or_7; (MODE) = SImode; \ } -/* Define this macro if the promotion described by `PROMOTE_MODE' - should also be done for outgoing function arguments. */ -/* This is required to ensure that push insns always push a word. */ -#define PROMOTE_FUNCTION_ARGS - /* Define this if most significant bit is lowest numbered in instructions that operate on numbered bit-fields. */ #define BITS_BIG_ENDIAN 0 @@ -1051,20 +1046,6 @@ extern const char * structure_size_string; /* Return the register number of the N'th (integer) argument. */ #define ARG_REGISTER(N) (N - 1) -#if 0 /* FIXME: The ARM backend has special code to handle structure - returns, and will reserve its own hidden first argument. So - if this macro is enabled a *second* hidden argument will be - reserved, which will break binary compatibility with old - toolchains and also thunk handling. One day this should be - fixed. */ -/* RTX for structure returns. NULL means use a hidden first argument. */ -#define STRUCT_VALUE 0 -#else -/* Register in which address to store a structure value - is passed to a function. */ -#define STRUCT_VALUE_REGNUM ARG_REGISTER (1) -#endif - /* Specify the registers used for certain standard purposes. The values of these macros are register numbers. */ @@ -2349,9 +2330,6 @@ do { \ /* Calling from registers is a massive pain. */ #define NO_FUNCTION_CSE 1 -/* Chars and shorts should be passed as ints. */ -#define PROMOTE_PROTOTYPES 1 - /* The machine modes of pointers and functions */ #define Pmode SImode #define FUNCTION_MODE Pmode