tm.texi (MEMBER_TYPE_FORCES_BLK): Document MODE argument.
authorAldy Hernandez <aldyh@redhat.com>
Sat, 15 Jun 2002 09:41:13 +0000 (09:41 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Sat, 15 Jun 2002 09:41:13 +0000 (09:41 +0000)
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

gcc/ChangeLog
gcc/config/c4x/c4x.h
gcc/config/ia64/hpux.h
gcc/doc/tm.texi
gcc/stor-layout.c

index d94145907864426f97fb00a8b5ac3e24b6a14f3a..75ee85301771e05aa4c154a6b61f06804408a4a2 100644 (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.
index a18dbebcd743ca4e362bde2eefdebae2e1b1018e..e73c40eb0a6929393dad78888d3fd8c0b8dacedc 100644 (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.  */
index 8b1867897cf358095cf5c0cdcb21f68feb786b60..561d629d64b52862f6bd629d722734c536a23d92 100644 (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
index cf08b12d149dc43865d1945179fe0aced0822987..446d2327d7424379b185b6df7b4fba30b125010a 100644 (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.
index 8569ca2538dc8d00d9dcba757bd0e1454576a282..753e41d29ade13847d0e4be6f78c90ba28795f87 100644 (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.  */