aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-12-30 11:09:58 +0000
committerRichard Stallman <rms@gnu.org>1992-12-30 11:09:58 +0000
commitf7c8fb3f491c56f5b8b8fd04f9325149cd250ee8 (patch)
tree180fe8d1d6fe29130bddb4c2d6578bda4e322bad /gcc
parent91d33e36a03b16ef089e852a721a59b65bc8373d (diff)
downloadgcc-f7c8fb3f491c56f5b8b8fd04f9325149cd250ee8.zip
gcc-f7c8fb3f491c56f5b8b8fd04f9325149cd250ee8.tar.gz
gcc-f7c8fb3f491c56f5b8b8fd04f9325149cd250ee8.tar.bz2
(c_sizeof, c_sizeof_nowarn, c_size_in_bytes): Call force_fit_type with
end result. From-SVN: r2996
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-typeck.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index b5d6a09..ec149be 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