From 25868f6cad6033f99e065cbec286171ec85268cd Mon Sep 17 00:00:00 2001 From: Scott Snyder Date: Fri, 29 May 1998 19:17:23 -0400 Subject: [PATCH] tree.c (layout_basetypes): If we change TYPE_SIZE, change TYPE_SIZE_UNIT too. * tree.c (layout_basetypes): If we change TYPE_SIZE, change TYPE_SIZE_UNIT too. From-SVN: r20142 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/tree.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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++)