aboutsummaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-06-30 03:10:06 +0000
committerRichard Stallman <rms@gnu.org>1992-06-30 03:10:06 +0000
commitd4c40650c2b74ed0bd3c17970e7d38f64c91a3cd (patch)
tree8d61cc929a37ca53844ef0d1d39ceb677000a3bd /gcc/stor-layout.c
parentf3ee8ad13396dad3d2cbded7a3d7db44f5c75d22 (diff)
downloadgcc-d4c40650c2b74ed0bd3c17970e7d38f64c91a3cd.zip
gcc-d4c40650c2b74ed0bd3c17970e7d38f64c91a3cd.tar.gz
gcc-d4c40650c2b74ed0bd3c17970e7d38f64c91a3cd.tar.bz2
*** empty log message ***
From-SVN: r1355
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 16d1dab..abf8638 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -40,6 +40,10 @@ tree size_zero_node;
tree size_one_node;
+/* If nonzero, this is an upper limit on alignment of structure fields.
+ The value is measured in bits. */
+int maximum_field_alignment;
+
#define GET_MODE_ALIGNMENT(MODE) \
MIN (BIGGEST_ALIGNMENT, \
MAX (1, (GET_MODE_UNIT_SIZE (MODE) * BITS_PER_UNIT)))
@@ -198,7 +202,12 @@ layout_decl (decl, known_align)
/* Conditions are: a fixed size that is correct for another mode
and occupying a complete byte or bytes on proper boundary. */
if (code == FIELD_DECL)
- DECL_BIT_FIELD_TYPE (decl) = DECL_BIT_FIELD (decl) ? type : 0;
+ {
+ DECL_BIT_FIELD_TYPE (decl) = DECL_BIT_FIELD (decl) ? type : 0;
+ if (maximum_field_alignment != 0)
+ DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), maximum_field_alignment);
+ }
+
if (DECL_BIT_FIELD (decl)
&& TYPE_SIZE (type) != 0
&& TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST)