From f7c8fb3f491c56f5b8b8fd04f9325149cd250ee8 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Wed, 30 Dec 1992 11:09:58 +0000 Subject: [PATCH] (c_sizeof, c_sizeof_nowarn, c_size_in_bytes): Call force_fit_type with end result. From-SVN: r2996 --- gcc/c-typeck.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index b5d6a09282a..ec149be22e4 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -702,6 +702,7 @@ c_sizeof (type) tree type; { enum tree_code code = TREE_CODE (type); + tree t; if (code == FUNCTION_TYPE) { @@ -724,8 +725,10 @@ c_sizeof (type) } /* Convert in case a char is more than one unit. */ - return size_binop (CEIL_DIV_EXPR, TYPE_SIZE (type), - size_int (TYPE_PRECISION (char_type_node))); + t = size_binop (CEIL_DIV_EXPR, TYPE_SIZE (type), + size_int (TYPE_PRECISION (char_type_node))); + force_fit_type (t); + return t; } tree @@ -733,6 +736,7 @@ c_sizeof_nowarn (type) tree type; { enum tree_code code = TREE_CODE (type); + tree t; if (code == FUNCTION_TYPE || code == VOID_TYPE @@ -742,8 +746,10 @@ c_sizeof_nowarn (type) return size_int (0); /* Convert in case a char is more than one unit. */ - return size_binop (CEIL_DIV_EXPR, TYPE_SIZE (type), - size_int (TYPE_PRECISION (char_type_node))); + t = size_binop (CEIL_DIV_EXPR, TYPE_SIZE (type), + size_int (TYPE_PRECISION (char_type_node))); + force_fit_type (t); + return t; } /* Compute the size to increment a pointer by. */ @@ -753,6 +759,7 @@ c_size_in_bytes (type) tree type; { enum tree_code code = TREE_CODE (type); + tree t; if (code == FUNCTION_TYPE) return size_int (1); @@ -767,8 +774,10 @@ c_size_in_bytes (type) } /* Convert in case a char is more than one unit. */ - return size_binop (CEIL_DIV_EXPR, TYPE_SIZE (type), + t = size_binop (CEIL_DIV_EXPR, TYPE_SIZE (type), size_int (BITS_PER_UNIT)); + force_fit_type (t); + return t; } /* Implement the __alignof keyword: Return the minimum required -- 2.30.2