(c_sizeof, c_sizeof_nowarn, c_size_in_bytes): Call force_fit_type with

end result.

From-SVN: r2996
This commit is contained in:
Richard Stallman 1992-12-30 11:09:58 +00:00
parent 91d33e36a0
commit f7c8fb3f49
1 changed files with 14 additions and 5 deletions

View File

@ -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