]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree.c (layout_basetypes): If we change TYPE_SIZE, change TYPE_SIZE_UNIT too.
authorScott Snyder <snyder@fnal.gov>
Fri, 29 May 1998 23:17:23 +0000 (19:17 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 29 May 1998 23:17:23 +0000 (19:17 -0400)
* tree.c (layout_basetypes): If we change TYPE_SIZE, change
TYPE_SIZE_UNIT too.

From-SVN: r20142

gcc/cp/ChangeLog
gcc/cp/tree.c

index 47725b2c7e13edb7263175037f4b51f552967ec2..16e5074143a8922af3427fed3e177be46a4085d0 100644 (file)
@@ -1,3 +1,8 @@
+1998-05-29  scott snyder  <snyder@d0sgif.fnal.gov>
+
+       * tree.c (layout_basetypes): If we change TYPE_SIZE, change
+       TYPE_SIZE_UNIT too.
+
 1998-05-29  Mark Mitchell  <mark@markmitchell.com>
 
        * decl.c (grokdeclarator): Don't complain about in-class
index a5f30eaa8515d6deb765199b074e8e4fb0c6fb85..c17c71a3138e302e1f8790dc26f96445804988c6 100644 (file)
@@ -722,7 +722,11 @@ layout_basetypes (rec, max)
    here, as that is for this class, without any virtual base classes.  */
   TYPE_ALIGN (rec) = record_align;
   if (const_size != nonvirtual_const_size)
-    TYPE_SIZE (rec) = size_int (const_size);
+    {
+      TYPE_SIZE (rec) = size_int (const_size);
+      TYPE_SIZE_UNIT (rec) = size_binop (FLOOR_DIV_EXPR, TYPE_SIZE (rec),
+                                         size_int (BITS_PER_UNIT));
+    }
 
   /* Now propagate offset information throughout the lattice.  */
   for (i = 0; i < n_baseclasses; i++)