(c_sizeof, c_sizeof_nowarn, c_size_in_bytes): Call force_fit_type with
authorRichard Stallman <rms@gnu.org>
Wed, 30 Dec 1992 11:09:58 +0000 (11:09 +0000)
committerRichard Stallman <rms@gnu.org>
Wed, 30 Dec 1992 11:09:58 +0000 (11:09 +0000)
end result.

From-SVN: r2996

gcc/c-typeck.c

index b5d6a09282aa06a52ef34bae788f2f3ebf8ada39..ec149be22e45c449b0630cf8de773424096b29a0 100644 (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