(layout_record, PCC_BITFIELD_TYPE_MATTERS): Round up when calculating
authorRichard Kenner <kenner@gcc.gnu.org>
Fri, 27 Jun 1997 14:36:37 +0000 (10:36 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 27 Jun 1997 14:36:37 +0000 (10:36 -0400)
possible end address.

From-SVN: r14326

gcc/stor-layout.c

index 8c2357aeeb7a1c3fe0dcb03da37da6d4737a685b..83bfb9956c903917020a7fa5d5b6fa3ab11bab4f 100644 (file)
@@ -440,7 +440,8 @@ layout_record (rec)
 
          /* A bit field may not span more units of alignment of its type
             than its type itself.  Advance to next boundary if necessary.  */
-         if (((const_size + field_size) / type_align - const_size / type_align)
+         if (((const_size + field_size + type_align - 1) / type_align
+              - const_size / type_align)
              > TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (field))) / type_align)
            const_size = CEIL (const_size, type_align) * type_align;
        }