diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 47725b2c7e1..16e5074143a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +1998-05-29 scott snyder + + * tree.c (layout_basetypes): If we change TYPE_SIZE, change + TYPE_SIZE_UNIT too. + 1998-05-29 Mark Mitchell * decl.c (grokdeclarator): Don't complain about in-class diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index a5f30eaa851..c17c71a3138 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -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++)