diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-13 07:45:09 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-13 07:45:09 +0000 |
commit | 0336f0f0a448f834556a8efb0cf4161c2e2a38d2 (patch) | |
tree | d6061a45fae079845a6d37d0db05d65b8eb6b121 /gcc/config/alpha | |
parent | 7af08043ace3927cfb9f6694a8aad643695cd73c (diff) | |
download | gcc-0336f0f0a448f834556a8efb0cf4161c2e2a38d2.tar.gz |
* target-def.h (TARGET_MUST_PASS_IN_STACK): New.
* target.h (struct gcc_target): Add calls.must_pass_in_stack.
* expr.h (MUST_PASS_IN_STACK): Remove.
* system.h (MUST_PASS_IN_STACK): Poison.
* tree.h (must_pass_in_stack_var_size): Declare.
(must_pass_in_stack_var_size_or_pad): Declare.
* calls.c (must_pass_in_stack_var_size): New.
(must_pass_in_stack_var_size_or_pad): Rename from
default_must_pass_in_stack.
* config/alpha/alpha.c (unicosmk_must_pass_in_stack): New.
(TARGET_MUST_PASS_IN_STACK): New.
* config/alpha/unicosmk.h (MUST_PASS_IN_STACK): Remove.
* config/fr30/fr30.c (fr30_must_pass_in_stack): New.
(TARGET_MUST_PASS_IN_STACK): New.
* config/fr30/fr30.h (MUST_PASS_IN_STACK): Remove.
* config/frv/frv.c (frv_must_pass_in_stack): New.
(TARGET_MUST_PASS_IN_STACK): New.
* config/frv/frv.h (MUST_PASS_IN_STACK): Remove.
* config/i386/i386-protos.h (ix86_must_pass_in_stack): Remove.
* config/i386/i386.c (TARGET_MUST_PASS_IN_STACK): New.
(ix86_must_pass_in_stack): Make static.
* config/i386/i386.h (MUST_PASS_IN_STACK): Remove.
* config/ia64/ia64.c (TARGET_MUST_PASS_IN_STACK): New.
* config/ia64/ia64.h (MUST_PASS_IN_STACK): Remove.
* config/m32r/m32r.c (TARGET_MUST_PASS_IN_STACK): New.
* config/m32r/m32r.h (MUST_PASS_IN_STACK): Remove.
* config/mcore/mcore-protos.h (mcore_must_pass_on_stack): Remove.
* config/mcore/mcore.c (TARGET_MUST_PASS_IN_STACK): New.
(mcore_must_pass_on_stack): Remove.
* config/mcore/mcore.h (MUST_PASS_IN_STACK): Remove.
* config/mips/mips.c (TARGET_MUST_PASS_IN_STACK): New.
* config/mips/mips.h (MUST_PASS_IN_STACK): Remove.
* config/pa/pa.c (TARGET_MUST_PASS_IN_STACK): New.
* config/pa/pa.h (MUST_PASS_IN_STACK): Remove.
* config/rs6000/aix.h (MUST_PASS_IN_STACK): Remove.
* config/rs6000/linux64.h (MUST_PASS_IN_STACK): Remove.
* config/rs6000/rs6000.c (rs6000_must_pass_in_stack): New.
(TARGET_MUST_PASS_IN_STACK): New.
* config/sh/sh.c (TARGET_MUST_PASS_IN_STACK): New.
* config/sh/sh.h (MUST_PASS_IN_STACK): Remove.
* config/sparc/sparc.c (TARGET_MUST_PASS_IN_STACK): New.
* config/sparc/sparc.h (MUST_PASS_IN_STACK): Remove.
* config/xtensa/xtensa.c (TARGET_MUST_PASS_IN_STACK): New.
* config/xtensa/xtensa.h (MUST_PASS_IN_STACK): Remove.
* doc/tm.texi (TARGET_MUST_PASS_IN_STACK): Update from
MUST_PASS_IN_STACK.
* calls.c, function.c, config/alpha/alpha.c, config/alpha/alpha.h,
config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.c,
config/cris/cris.h, config/fr30/fr30.c, config/fr30/fr30.h,
config/frv/frv.c, config/i386/i386.c, config/iq2000/iq2000.c,
config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c,
config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000.c,
config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c,
config/xtensa/xtensa.c: Use target hook.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84606 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/alpha')
-rw-r--r-- | gcc/config/alpha/alpha.c | 32 | ||||
-rw-r--r-- | gcc/config/alpha/alpha.h | 7 | ||||
-rw-r--r-- | gcc/config/alpha/unicosmk.h | 14 | ||||
-rw-r--r-- | gcc/config/alpha/vms.h | 2 |
4 files changed, 34 insertions, 21 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 19bf341bfdf..422d6c6a44c 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -5842,7 +5842,8 @@ function_arg (CUMULATIVE_ARGS cum, enum machine_mode mode, tree type, return alpha_arg_info_reg_val (cum); num_args = cum.num_args; - if (num_args >= 6 || MUST_PASS_IN_STACK (mode, type)) + if (num_args >= 6 + || targetm.calls.must_pass_in_stack (mode, type)) return NULL_RTX; } #elif TARGET_ABI_UNICOSMK @@ -5885,8 +5886,9 @@ function_arg (CUMULATIVE_ARGS cum, enum machine_mode mode, tree type, size = ALPHA_ARG_SIZE (mode, type, named); num_args = cum.num_reg_words; - if (MUST_PASS_IN_STACK (mode, type) - || cum.num_reg_words + size > 6 || cum.force_stack) + if (cum.force_stack + || cum.num_reg_words + size > 6 + || targetm.calls.must_pass_in_stack (mode, type)) return NULL_RTX; else if (type && TYPE_MODE (type) == BLKmode) { @@ -5918,7 +5920,7 @@ function_arg (CUMULATIVE_ARGS cum, enum machine_mode mode, tree type, /* VOID is passed as a special flag for "last argument". */ if (type == void_type_node) basereg = 16; - else if (MUST_PASS_IN_STACK (mode, type)) + else if (targetm.calls.must_pass_in_stack (mode, type)) return NULL_RTX; else if (FUNCTION_ARG_PASS_BY_REFERENCE (cum, mode, type, named)) basereg = 16; @@ -6232,7 +6234,7 @@ alpha_gimplify_va_arg_1 (tree type, tree base, tree offset, tree *pre_p) /* If the type could not be passed in registers, skip the block reserved for the registers. */ - if (MUST_PASS_IN_STACK (TYPE_MODE (type), type)) + if (targetm.calls.must_pass_in_stack (TYPE_MODE (type), type)) { t = fold_convert (TREE_TYPE (offset), build_int_2 (6*8, 0)); t = build (MODIFY_EXPR, TREE_TYPE (offset), offset, @@ -9285,6 +9287,24 @@ alpha_use_linkage (rtx linkage ATTRIBUTE_UNUSED, #if TARGET_ABI_UNICOSMK +/* This evaluates to true if we do not know how to pass TYPE solely in + registers. This is the case for all arguments that do not fit in two + registers. */ + +static bool +unicosmk_must_pass_in_stack (enum machine_mode mode, tree type) +{ + if (type == NULL) + return false; + + if (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) + return true; + if (TREE_ADDRESSABLE (type)) + return true; + + return ALPHA_ARG_SIZE (mode, type, 0) > 2; +} + /* Define the offset between two registers, one to be eliminated, and the other its replacement, at the start of a routine. */ @@ -10078,6 +10098,8 @@ alpha_init_libfuncs (void) # define TARGET_ASM_UNIQUE_SECTION unicosmk_unique_section # undef TARGET_ASM_GLOBALIZE_LABEL # define TARGET_ASM_GLOBALIZE_LABEL hook_void_FILEptr_constcharptr +# undef TARGET_MUST_PASS_IN_STACK +# define TARGET_MUST_PASS_IN_STACK unicosmk_must_pass_in_stack #endif #undef TARGET_ASM_ALIGNED_HI_OP diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h index 8dbdeb03187..e142e5e177a 100644 --- a/gcc/config/alpha/alpha.h +++ b/gcc/config/alpha/alpha.h @@ -1040,10 +1040,9 @@ extern int alpha_memory_latency; (TYPE is null for libcalls where that information may not be available.) */ #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ - if (MUST_PASS_IN_STACK (MODE, TYPE)) \ - (CUM) = 6; \ - else \ - (CUM) += ALPHA_ARG_SIZE (MODE, TYPE, NAMED) + ((CUM) += \ + (targetm.calls.must_pass_in_stack (MODE, TYPE)) \ + ? 6 : ALPHA_ARG_SIZE (MODE, TYPE, NAMED)) /* Determine where to put an argument to a function. Value is zero to push the argument on the stack, diff --git a/gcc/config/alpha/unicosmk.h b/gcc/config/alpha/unicosmk.h index d1dfe912622..7c9a6073fa6 100644 --- a/gcc/config/alpha/unicosmk.h +++ b/gcc/config/alpha/unicosmk.h @@ -124,15 +124,6 @@ Boston, MA 02111-1307, USA. */ #define STACK_PARMS_IN_REG_PARM_AREA -/* This evaluates to nonzero if we do not know how to pass TYPE solely in - registers. This is the case for all arguments that do not fit in two - registers. */ - -#define MUST_PASS_IN_STACK(MODE,TYPE) \ - ((TYPE) != 0 \ - && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ - || (TREE_ADDRESSABLE (TYPE) || ALPHA_ARG_SIZE (MODE, TYPE, 0) > 2))) - /* Define a data type for recording info about an argument list during the scan of that argument list. This data type should hold all necessary information about the function itself @@ -198,8 +189,9 @@ do { \ \ size = ALPHA_ARG_SIZE (MODE, TYPE, NAMED); \ \ - if (size > 2 || MUST_PASS_IN_STACK (MODE, TYPE) \ - || (CUM).num_reg_words + size > 6) \ + if (size > 2 \ + || (CUM).num_reg_words + size > 6 \ + || targetm.calls.must_pass_in_stack (MODE, TYPE)) \ (CUM).force_stack = 1; \ \ if (! (CUM).force_stack) \ diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h index f7058f3ff39..b062d616c00 100644 --- a/gcc/config/alpha/vms.h +++ b/gcc/config/alpha/vms.h @@ -179,7 +179,7 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info; #undef FUNCTION_ARG_ADVANCE #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ - if (MUST_PASS_IN_STACK (MODE, TYPE)) \ + if (targetm.calls.must_pass_in_stack (MODE, TYPE)) \ (CUM).num_args += 6; \ else \ { \ |