tm.texi (MEMBER_TYPE_FORCES_BLK): Document MODE argument.

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.

From-SVN: r54643
This commit is contained in:
Aldy Hernandez 2002-06-15 09:41:13 +00:00 committed by Aldy Hernandez
parent 2313d59405
commit 182e515e72
5 changed files with 25 additions and 16 deletions

View file

@ -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.

View file

@ -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. */

View file

@ -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

View file

@ -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.

View file

@ -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. */