Commit d627ed1b by Richard Stallman

(default_conversion): Use C_PROMOTING_INTEGER_TYPE_P to decide whether a type should promote.

(default_conversion): Use C_PROMOTING_INTEGER_TYPE_P
to decide whether a type should promote.
(self_promoting_args_p, self_promoting_type_p): Likewise.

From-SVN: r1665
parent 674c724c
...@@ -601,12 +601,13 @@ self_promoting_args_p (parms) ...@@ -601,12 +601,13 @@ self_promoting_args_p (parms)
if (TREE_CHAIN (t) == 0 && type != void_type_node) if (TREE_CHAIN (t) == 0 && type != void_type_node)
return 0; return 0;
if (type == 0)
return 0;
if (TYPE_MAIN_VARIANT (type) == float_type_node) if (TYPE_MAIN_VARIANT (type) == float_type_node)
return 0; return 0;
if (type if (C_PROMOTING_INTEGER_TYPE_P (type))
&& TREE_CODE (type) == INTEGER_TYPE
&& TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
return 0; return 0;
} }
return 1; return 1;
...@@ -621,8 +622,7 @@ self_promoting_type_p (type) ...@@ -621,8 +622,7 @@ self_promoting_type_p (type)
if (TYPE_MAIN_VARIANT (type) == float_type_node) if (TYPE_MAIN_VARIANT (type) == float_type_node)
return 0; return 0;
if (TREE_CODE (type) == INTEGER_TYPE if (C_PROMOTING_INTEGER_TYPE_P (type))
&& TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
return 0; return 0;
return 1; return 1;
...@@ -908,12 +908,12 @@ default_conversion (exp) ...@@ -908,12 +908,12 @@ default_conversion (exp)
return convert (type, exp); return convert (type, exp);
} }
if (code == INTEGER_TYPE if (C_PROMOTING_INTEGER_TYPE_P (type))
&& (TYPE_PRECISION (type)
< TYPE_PRECISION (integer_type_node)))
{ {
/* Traditionally, unsignedness is preserved in default promotions. */ /* Traditionally, unsignedness is preserved in default promotions. */
if (flag_traditional && TREE_UNSIGNED (type)) if ((flag_traditional && TREE_UNSIGNED (type))
/* Also preserve unsignedness if not really getting any wider. */
|| (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node)))
return convert (unsigned_type_node, exp); return convert (unsigned_type_node, exp);
return convert (integer_type_node, exp); return convert (integer_type_node, exp);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment