From 7f16bdb85adcbdea2096397cfaf4e091ac5c4f51 Mon Sep 17 00:00:00 2001 From: wilson Date: Sat, 30 Oct 1999 00:18:23 +0000 Subject: [PATCH] Fix mn10200-elf libio build failure, and minor performance regression. * stor-layout.c (layout_type): When compute TYPE_SIZE_UNIT from TYPE_SIZE, convert type of result to sizetype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30270 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/stor-layout.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 37642fc..756d6c3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Fri Oct 29 17:00:42 1999 Jim Wilson + + * stor-layout.c (layout_type): When compute TYPE_SIZE_UNIT from + TYPE_SIZE, convert type of result to sizetype. + Fri Oct 29 14:34:17 1999 Richard Henderson * flow.c (count_or_remove_death_notes): Equate NULL with the diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index f8a1e1d..3663293 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1106,8 +1106,12 @@ layout_type (type) of the type above, find it by division. */ if (TYPE_SIZE_UNIT (type) == 0 && TYPE_SIZE (type) != 0) { - TYPE_SIZE_UNIT (type) = size_binop (FLOOR_DIV_EXPR, TYPE_SIZE (type), - size_int (BITS_PER_UNIT)); + /* TYPE_SIZE (type) is computed in bitsizetype. After the division, the + result will fit in sizetype. We will get more efficient code using + sizetype, so we force a conversion. */ + tree unit_size = size_binop (FLOOR_DIV_EXPR, TYPE_SIZE (type), + size_int (BITS_PER_UNIT)); + TYPE_SIZE_UNIT (type) = convert (sizetype, unit_size); } /* Once again evaluate only once, either now or as soon as safe. */ -- 2.7.4