diff options
-rw-r--r-- | gcc/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/config/c4x/c4x.h | 6 | ||||
-rw-r--r-- | gcc/config/ia64/hpux.h | 2 | ||||
-rw-r--r-- | gcc/doc/tm.texi | 7 | ||||
-rw-r--r-- | gcc/stor-layout.c | 13 |
5 files changed, 25 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d941459..75ee853 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2002-06-15 Aldy Hernandez <aldyh@redhat.com> + + * 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 <jsturm@one-point.com> * 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 a18dbeb..e73c40e 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 8b18678..561d629 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 cf08b12..446d232 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 8569ca2..753e41d 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. */ |