diff options
author | froydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-16 14:25:07 +0000 |
---|---|---|
committer | froydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-16 14:25:07 +0000 |
commit | bd99ba644995e1def47dc92160427cba7aa04b94 (patch) | |
tree | e272ca26ebebda9e3693e93448028f82a90b0575 /gcc/config/pa | |
parent | c7e41aee2b459879f2e093101b0a4bd661a15563 (diff) | |
download | gcc-bd99ba644995e1def47dc92160427cba7aa04b94.tar.gz |
* builtins.c (std_gimplify_va_arg_expr): Use
targetm.calls.function_arg_boundary.
* function.c (assign_parms, locate_and_pad_parm): Likewise.
* calls.c (struct arg_data): Update comment.
* defaults.h (FUNCTION_ARG_BOUNDARY): Delete.
* target.def (function_arg_boundary): Define.
* targhooks.h (default_function_arg_boundary): Declare.
* targhooks.c (default_function_arg_boundary): Define.
* doc/tm.texi.in (FUNCTION_ARG_PADDING): Use
TARGET_FUNCTION_ARG_BOUNDARY.
(FUNCTION_ARG_BOUNDARY): Delete.
(TARGET_FUNCTION_ARG_BOUNDARY): New.
* doc/tm.texi: Regenerate.
* system.h (FUNCTION_ARG_BOUNDARY): Poison.
* config/arc/arc.h (FUNCTION_ARG_BOUNDARY): Delete.
* config/arc/arc.c (arc_function_arg_boundary): Define.
(TARGET_FUNCTION_ARG_BOUNDARY): Define.
* config/arm/arm.h (FUNCTION_ARG_BOUNDARY): Delete.
* config/arm/arm-protos.h (arm_needs_doubleword_align): Delete.
* config/arm/arm.c (arm_needs_doubleword_align): Make static.
(arm_function_arg_boundary): Define.
(TARGET_FUNCTION_ARG_BOUNDARY): Define.
* config/frv/frv.h (FUNCTION_ARG_BOUNDARY): Delete.
* config/frv/frv-protos.h (frv_function_arg_boundary): Delete.
* config/frv/frv.c (frv_function_arg_boundary): Make static.
(TARGET_FUNCTION_ARG_BOUNDARY): Define.
* config/i386/i386.h (FUNCTION_ARG_BOUNDARY): Delete.
* config/i386/i386-protos.h (ix86_function_arg_boundary): Delete.
* config/i386/i386.c (ix86_function_arg_boundary): Make static.
(ix86_compat_function_arg_boundary): Take and return unsigned int.
(TARGET_FUNCTION_ARG_BOUNDARY): Define.
* config/ia64/ia64.h (FUNCTION_ARG_BOUNDARY): Delete.
* config/ia64/ia64-protos.h (ia64_function_arg_boundary): Delete.
* config/ia64/ia64.c (ia64_function_arg_boundary): Make static.
(TARGET_FUNCTION_ARG_BOUNDARY): Define.
* config/m32c/m32c.h (FUNCTION_ARG_BOUNDARY): Delete.
* config/m32c/m32c.c (m32c_function_arg_boundary): Define.
(TARGET_FUNCTION_ARG_BOUNDARY): Define.
* config/m32r/m32r.h (FUNCTION_ARG_BOUNDARY): Delete.
* config/mcore/mcore.h (FUNCTION_ARG_BOUNDARY): Delete.
* config/mcore/mcore.c (mcore_function_arg_boundary): Define.
(TARGET_FUNCTION_ARG_BOUNDARY): Define.
* config/mips/mips.h (FUNCTION_ARG_BOUNDARY): Delete.
* config/mips/mips-protos.h (mips_function_arg_boundary): Delete.
* config/mips/mips.c (mips_function_arg_boundary): Make static.
(TARGET_FUNCTION_ARG_BOUNDARY): Define.
* config/pa/pa.h (FUNCTION_ARG_BOUNDARY): Delete.
* config/pa/pa.c (pa_function_arg_boundary): Define.
(TARGET_FUNCTION_ARG_BOUNDARY): Define.
* config/picochip/picochip.h (FUNCTION_ARG_BOUNDARY): Delete.
* config/picochip/picochip-protos.h
(picochip_get_function_arg_boundary): Delete.
* config/picochip/picochip.c (picochip_get_function_arg_boundary):
Rename to...
(picochip_function_arg_boundary): ...this. Make static.
(picochip_function_arg, picochip_arg_partial_bytes): Adjust.
(picochip_arg_advance): Adjust.
(TARGET_FUNCTION_ARG_BOUNDARY): Define.
* config/rs6000/rs6000.h (FUNCTION_ARG_BOUNDARY): Delete.
* config/rs6000/rs6000-protos.h (function_arg_boundary): Delete.
* config/rs6000/rs6000.c (function_arg_boundary): Rename to...
(rs6000_function_arg_boundary): ...this. Make static.
(rs6000_parm_start, rs6000_gimplify_va_arg): Adjust.
(TARGET_FUNCTION_ARG_BOUNDARY): Define.
* config/rx/rx.h (FUNCTION_ARG_BOUNDARY): Delete.
* config/rx/rx.c (rx_function_arg_boundary): Define.
(TARGET_FUNCTION_ARG_BOUNDARY): Define.
* config/sparc/sparc.h (FUNCTION_ARG_BOUNDARY): Delete.
* config/sparc/sparc.c (sparc_function_arg_boundary): Define.
(TARGET_FUNCTION_ARG_BOUNDARY): Define.
* config/xtensa/xtensa.h (FUNCTION_ARG_BOUNDARY): Delete.
* config/xtensa/xtensa-protos.h (function_arg_boundary): Delete.
* config/xtensa/xtensa.c (function_arg_boundary): Rename to...
(xtensa_function_arg_boundary): ...this. Make static.
(TARGET_FUNCTION_ARG_BOUNDARY): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166803 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/pa')
-rw-r--r-- | gcc/config/pa/pa.c | 17 | ||||
-rw-r--r-- | gcc/config/pa/pa.h | 14 |
2 files changed, 17 insertions, 14 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 076d2dec755..988d80fcd1f 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -164,6 +164,7 @@ static void pa_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool); static rtx pa_function_arg (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool); +static unsigned int pa_function_arg_boundary (enum machine_mode, const_tree); static struct machine_function * pa_init_machine_status (void); static reg_class_t pa_secondary_reload (bool, rtx, reg_class_t, enum machine_mode, @@ -351,6 +352,8 @@ static const struct default_options pa_option_optimization_table[] = #define TARGET_FUNCTION_ARG pa_function_arg #undef TARGET_FUNCTION_ARG_ADVANCE #define TARGET_FUNCTION_ARG_ADVANCE pa_function_arg_advance +#undef TARGET_FUNCTION_ARG_BOUNDARY +#define TARGET_FUNCTION_ARG_BOUNDARY pa_function_arg_boundary #undef TARGET_EXPAND_BUILTIN_SAVEREGS #define TARGET_EXPAND_BUILTIN_SAVEREGS hppa_builtin_saveregs @@ -9600,6 +9603,20 @@ pa_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, return retval; } +/* Arguments larger than one word are double word aligned. */ + +static unsigned int +pa_function_arg_boundary (enum machine_mode mode, const_tree type) +{ + tree size = TYPE_SIZE (type); + bool singleword = (type + ? (integer_zerop (size) + || !TREE_CONSTANT (size) + || int_size_in_bytes (type) <= UNITS_PER_WORD) + : GET_MODE_SIZE (mode)); + + return singleword ? PARM_BOUNDARY : MAX_PARM_BOUNDARY; +} /* If this arg would be passed totally in registers or totally on the stack, then this routine should return zero. */ diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index 46c210ef7fb..64c8926cf6b 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -687,20 +687,6 @@ struct hppa_args {int words, nargs_prototype, incoming, indirect; }; #define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \ function_arg_padding ((MODE), (TYPE)) -/* If defined, a C expression that gives the alignment boundary, in - bits, of an argument with the specified mode and type. If it is - not defined, `PARM_BOUNDARY' is used for all arguments. */ - -/* Arguments larger than one word are double word aligned. */ - -#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \ - (((TYPE) \ - ? (integer_zerop (TYPE_SIZE (TYPE)) \ - || !TREE_CONSTANT (TYPE_SIZE (TYPE)) \ - || int_size_in_bytes (TYPE) <= UNITS_PER_WORD) \ - : GET_MODE_SIZE(MODE) <= UNITS_PER_WORD) \ - ? PARM_BOUNDARY : MAX_PARM_BOUNDARY) - /* On HPPA, we emit profiling code as rtl via PROFILE_HOOK rather than as assembly via FUNCTION_PROFILER. Just output a local label. |