From 0d7839daeef826108df3788cc82c198df2e56b2d Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Tue, 11 Dec 2001 23:04:36 +0000 Subject: tm.texi (FUNCTION_ARG_REG_LITTLE_ENDIAN): New. 2001-12-11 Steve Ellcey * doc/tm.texi (FUNCTION_ARG_REG_LITTLE_ENDIAN): New. * defaults.h (FUNCTION_ARG_REG_LITTLE_ENDIAN): New. * calls.c (store_unaligned_arguments_into_pseudos): Check FUNCTION_ARG_REG_LITTLE_ENDIAN to see how structures are passed/returned. * expr.c (move_block_from_reg): Ditto. (move_block_from_reg): Ditto. (copy_blkmode_from_reg): Ditto. * stmt.c (expand_return): Ditto. * stor-layout.c (compute_record_mode): If FUNCTION_ARG_REG_LITTLE_ENDIAN is set then check MEMBER_TYPE_FORCES_BLK even if mode == VOIDmode. * config/ia64/hpux.h (MEMBER_TYPE_FORCES_BLK): Set to true so that Structures of one field are still treated as structures. (FUNCTION_ARG_REG_LITTLE_ENDIAN): New, set it to true. (FUNCTION_ARG_PADDING): Set to ia64_hpux_function_arg_padding(). (PAD_VARARGS_DOWN): Modify from default to not pad structures down. * config/ia64/ia64-protos.h (ia64_hpux_function_arg_padding): New. * config/ia64/ia64.c (ia64_hpux_function_arg_padding): New function to special case handling of structure padding. From-SVN: r47904 --- gcc/stor-layout.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'gcc/stor-layout.c') diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 05eaf24..f657463 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1149,7 +1149,17 @@ compute_record_mode (type) #ifdef MEMBER_TYPE_FORCES_BLK /* With some targets, eg. c4x, it is sub-optimal to access an aligned BLKmode structure as a scalar. */ - if (mode == VOIDmode && MEMBER_TYPE_FORCES_BLK (field)) + + /* On ia64-*-hpux we need to ensure that we don't change the + mode of a structure containing a single field or else we + will pass it incorrectly. Since a structure with a single + field causes mode to get set above we can't allow the + check for mode == VOIDmode in this case. Perhaps + MEMBER_TYPE_FORCES_BLK should be extended to include mode + as an argument and the check could be put in there for c4x. */ + + if ((mode == VOIDmode || FUNCTION_ARG_REG_LITTLE_ENDIAN) + && MEMBER_TYPE_FORCES_BLK (field)) return; #endif /* MEMBER_TYPE_FORCES_BLK */ } -- cgit v1.1