diff options
author | Richard Henderson <rth@redhat.com> | 2004-07-13 00:45:09 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-07-13 00:45:09 -0700 |
commit | fe9841365eb7e2908f9ba6b18a85910ee9024a54 (patch) | |
tree | d6061a45fae079845a6d37d0db05d65b8eb6b121 /gcc/calls.c | |
parent | 29f1711877a0f3f6f7e36d22f4a53b0161591d4e (diff) | |
download | gcc-fe9841365eb7e2908f9ba6b18a85910ee9024a54.zip gcc-fe9841365eb7e2908f9ba6b18a85910ee9024a54.tar.gz gcc-fe9841365eb7e2908f9ba6b18a85910ee9024a54.tar.bz2 |
target-def.h (TARGET_MUST_PASS_IN_STACK): New.
* 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.
From-SVN: r84606
Diffstat (limited to 'gcc/calls.c')
-rw-r--r-- | gcc/calls.c | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/gcc/calls.c b/gcc/calls.c index c54ab48..e128162 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1097,7 +1097,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, = FUNCTION_ARG_PARTIAL_NREGS (*args_so_far, mode, type, argpos < n_named_args); - args[i].pass_on_stack = MUST_PASS_IN_STACK (mode, type); + args[i].pass_on_stack = targetm.calls.must_pass_in_stack (mode, type); /* If FUNCTION_ARG returned a (parallel [(expr_list (nil) ...) ...]), it means that we are to pass this arg in the register(s) designated @@ -4445,24 +4445,33 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, return sibcall_failure; } -/* Nonzero if we do not know how to pass TYPE solely in registers. - We cannot do so in the following cases: +/* Nonzero if we do not know how to pass TYPE solely in registers. */ - - if the type has variable size - - if the type is marked as addressable (it is required to be constructed - into the stack) - - if the padding and mode of the type is such that a copy into a register - would put it into the wrong part of the register. +bool +must_pass_in_stack_var_size (enum machine_mode mode ATTRIBUTE_UNUSED, + tree type) +{ + if (!type) + return false; + + /* If the type has variable size... */ + if (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) + return true; - Which padding can't be supported depends on the byte endianness. + /* If the type is marked as addressable (it is required + to be constructed into the stack)... */ + if (TREE_ADDRESSABLE (type)) + return true; + + return false; +} - A value in a register is implicitly padded at the most significant end. - On a big-endian machine, that is the lower end in memory. - So a value padded in memory at the upper end can't go in a register. - For a little-endian machine, the reverse is true. */ +/* Another version of the TARGET_MUST_PASS_IN_STACK hook. This one + takes trailing padding of a structure into account. */ +/* ??? Should be able to merge these two by examining BLOCK_REG_PADDING. */ bool -default_must_pass_in_stack (enum machine_mode mode, tree type) +must_pass_in_stack_var_size_or_pad (enum machine_mode mode, tree type) { if (!type) return false; |