*** empty log message ***
authorRichard Stallman <rms@gnu.org>
Tue, 30 Jun 1992 03:10:06 +0000 (03:10 +0000)
committerRichard Stallman <rms@gnu.org>
Tue, 30 Jun 1992 03:10:06 +0000 (03:10 +0000)
From-SVN: r1355

gcc/stor-layout.c

index 16d1dab63bd238351260b550757cf576a859f298..abf8638ea754b3fb888ad2a9a2641b44bd528cb8 100644 (file)
@@ -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)