summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorm.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4>2000-01-13 10:43:35 +0000
committerm.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4>2000-01-13 10:43:35 +0000
commit4a6a7d073eddcd3546d54ab212b857b0afd58752 (patch)
tree174b996c97c3d482dba85461cbd36b0c82d92621 /gcc
parentc2a76a0f385249e4226a23694ad2dafa43c3eb14 (diff)
downloadgcc-4a6a7d073eddcd3546d54ab212b857b0afd58752.tar.gz
* stor-layout.c (layout_type): Use FORCE_STRUCT_BLK.
* tm.texi (FORCE_STRUCT_BLK): Document. * config/c4x/c4x.h (FORCE_STRUCT_BLK): New macro. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31385 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/c4x/c4x.h4
-rw-r--r--gcc/stor-layout.c7
-rw-r--r--gcc/tm.texi9
4 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0a6a8a610ae..cc95cab01bc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h
index b6b43bebe32..470d6578010 100644
--- a/gcc/config/c4x/c4x.h
+++ b/gcc/config/c4x/c4x.h
@@ -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
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index e9c3740c26f..455152f88a3 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -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)
diff --git a/gcc/tm.texi b/gcc/tm.texi
index 385a0dcb940..dac44ae8ff8 100644
--- a/gcc/tm.texi
+++ b/gcc/tm.texi
@@ -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: