]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
stor-layout.c (layout_type): Use FORCE_STRUCT_BLK.
authorMichael Hayes <m.hayes@elec.canterbury.ac.nz>
Thu, 13 Jan 2000 10:43:35 +0000 (10:43 +0000)
committerMichael Hayes <m.hayes@gcc.gnu.org>
Thu, 13 Jan 2000 10:43:35 +0000 (10:43 +0000)
* stor-layout.c (layout_type): Use FORCE_STRUCT_BLK.
* tm.texi (FORCE_STRUCT_BLK): Document.
* config/c4x/c4x.h (FORCE_STRUCT_BLK): New macro.

From-SVN: r31385

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

index 0a6a8a610ae40bdbe195b6f26415a6f88c850831..cc95cab01bc72adb424c3ab46ef7a843c78b65c4 100644 (file)
@@ -1,3 +1,9 @@
+2000-01-13  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
+
+       * stor-layout.c (layout_type): Use FORCE_STRUCT_BLK.
+       * tm.texi (FORCE_STRUCT_BLK): Document.
+       * config/c4x/c4x.h (FORCE_STRUCT_BLK): New macro.
+
 Wed Jan 12 23:12:47 2000  Hans-Peter Nilsson  <hp@axis.com>
 
        * config/ns32k/ns32k.md: Revert Jan 9 change.
index b6b43bebe32a068e74930efbad2565349ddb842d..470d657801049f7eca6d4364ff2ed1b8c9989e27 100644 (file)
@@ -352,6 +352,10 @@ extern const char *c4x_rpts_cycles_string, *c4x_cpu_version_string;
 #define TARGET_FLOAT_FORMAT    C4X_FLOAT_FORMAT
 #define MAX_FIXED_MODE_SIZE    64 /* HImode.  */
 
+/* If a structure has a floating point field then force structure
+   to have BLKMODE.  */
+#define STRUCT_FORCE_BLK(FIELD) (TREE_CODE (TREE_TYPE (FIELD)) == REAL_TYPE)
+
 /* Number of bits in the high and low parts of a two stage
    load of an immediate constant.  */
 #define BITS_PER_HIGH 16
index e9c3740c26f04b5800777264fb5fbf099f3f4e83..455152f88a304cefb9ad78fa8fa3cc5b82bb7311 100644 (file)
@@ -1057,6 +1057,13 @@ layout_type (type)
                 register instead of forcing it to live in the stack.  */
              if (simple_cst_equal (TYPE_SIZE (type), DECL_SIZE (field)))
                mode = DECL_MODE (field);
+
+#ifdef STRUCT_FORCE_BLK
+             /* With some targets, eg. c4x, it is sub-optimal
+                to access an aligned BLKmode structure as a scalar.  */
+             if (mode == VOIDmode && STRUCT_FORCE_BLK (field))
+                 goto record_lose;
+#endif /* STRUCT_FORCE_BLK  */
            }
 
          if (mode != VOIDmode)
index 385a0dcb940e3ccaf337b06a61d2e97f32d41452..dac44ae8ff8635510c685459b810854c2ccecbe1 100644 (file)
@@ -413,6 +413,15 @@ if any, in all upper-case letters.  For example, it might be @samp{GCC}
 or @samp{BINUTILS}.  If the package is part of the a vendor-supplied
 operating system, code the component name as @samp{0}.
 
+@findex STRUCT_FORCE_BLK
+@item STRUCT_FORCE_BLK (@var{field})
+Return 1 if a structure containing @var{field} should be accessed using
+@code{BLKMODE}.
+
+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.
+
 
 For example, here is the definition used for VAX/VMS: