From: Aldy Hernandez Date: Sat, 15 Jun 2002 09:41:13 +0000 (+0000) Subject: tm.texi (MEMBER_TYPE_FORCES_BLK): Document MODE argument. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=182e515e724e29aaa44873ea71333fd799ee3925;p=gcc.git tm.texi (MEMBER_TYPE_FORCES_BLK): Document MODE argument. 2002-06-15 Aldy Hernandez * tm.texi (MEMBER_TYPE_FORCES_BLK): Document MODE argument. * stor-layout.c (compute_record_mode): Remove check for FUNCTION_ARG_REG_LITTLE_ENDIAN and VOIDmode when checking for MEMBER_TYPE_FORCES_BLK. Pass new mode field to MEMBER_TYPE_FORCES_BLK. * config/ia64/hpux.h (MEMBER_TYPE_FORCES_BLK): Same. * config/c4x/c4x.h (MEMBER_TYPE_FORCES_BLK): Same. From-SVN: r54643 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d9414590786..75ee8530177 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2002-06-15 Aldy Hernandez + + * tm.texi (MEMBER_TYPE_FORCES_BLK): Document MODE argument. + + * stor-layout.c (compute_record_mode): Remove check for + FUNCTION_ARG_REG_LITTLE_ENDIAN and VOIDmode when checking for + MEMBER_TYPE_FORCES_BLK. Pass new mode field to + MEMBER_TYPE_FORCES_BLK. + + * config/ia64/hpux.h (MEMBER_TYPE_FORCES_BLK): Same. + + * config/c4x/c4x.h (MEMBER_TYPE_FORCES_BLK): Same. + 2002-06-14 Jeff Sturm * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS): Add SPARC_STACK_BIAS. diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h index a18dbebcd74..e73c40eb0a6 100644 --- a/gcc/config/c4x/c4x.h +++ b/gcc/config/c4x/c4x.h @@ -378,9 +378,9 @@ extern const char *c4x_rpts_cycles_string, *c4x_cpu_version_string; #define MAX_FIXED_MODE_SIZE 64 /* HImode. */ /* If a structure has a floating point field then force structure - to have BLKMODE. */ -#define MEMBER_TYPE_FORCES_BLK(FIELD) \ - (TREE_CODE (TREE_TYPE (FIELD)) == REAL_TYPE) + to have BLKMODE, unless it is the only field. */ +#define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) \ + (TREE_CODE (TREE_TYPE (FIELD)) == REAL_TYPE && (MODE) == VOIDmode) /* Number of bits in the high and low parts of a two stage load of an immediate constant. */ diff --git a/gcc/config/ia64/hpux.h b/gcc/config/ia64/hpux.h index 8b1867897cf..561d629d64b 100644 --- a/gcc/config/ia64/hpux.h +++ b/gcc/config/ia64/hpux.h @@ -103,7 +103,7 @@ Boston, MA 02111-1307, USA. */ structure handling, this macro simply ensures that single field structures are always treated like structures. */ -#define MEMBER_TYPE_FORCES_BLK(FIELD) 1 +#define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) 1 /* Override the setting of FUNCTION_ARG_REG_LITTLE_ENDIAN in defaults.h. Setting this to true means that we are not passing diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index cf08b12d149..446d2327d74 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -1213,10 +1213,15 @@ Like @code{PCC_BITFIELD_TYPE_MATTERS} except that its effect is limited to aligning a bit-field within the structure. @findex MEMBER_TYPE_FORCES_BLK -@item MEMBER_TYPE_FORCES_BLK (@var{field}) +@item MEMBER_TYPE_FORCES_BLK (@var{field}, @var{mode}) Return 1 if a structure or array containing @var{field} should be accessed using @code{BLKMODE}. +If @var{field} is the only field in the structure, @var{mode} is its +mode, otherwise @var{mode} is VOIDmode. @var{mode} is provided in the +case where structures of one field would require the structure's mode to +retain the field's mode. + Normally, this is not needed. See the file @file{c4x.h} for an example of how to use this macro to prevent a structure having a floating point field from being accessed in an integer mode. diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 8569ca2538d..753e41d29ad 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1228,16 +1228,7 @@ compute_record_mode (type) /* With some targets, eg. c4x, it is sub-optimal to access an aligned BLKmode structure as a scalar. */ - /* 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)) + if (MEMBER_TYPE_FORCES_BLK (field, mode)) return; #endif /* MEMBER_TYPE_FORCES_BLK */ } @@ -1577,7 +1568,7 @@ layout_type (type) TYPE_MODE (type) = BLKmode; if (TYPE_SIZE (type) != 0 #ifdef MEMBER_TYPE_FORCES_BLK - && ! MEMBER_TYPE_FORCES_BLK (type) + && ! MEMBER_TYPE_FORCES_BLK (type, VOIDmode) #endif /* BLKmode elements force BLKmode aggregate; else extract/store fields may lose. */