Commit e83d45c4 by Richard Stallman

(default_conversion): Fix bug that

promotes short to unsigned if sizeof(short) == sizeof(int).

From-SVN: r1784
parent 5f31db15
......@@ -910,10 +910,11 @@ default_conversion (exp)
if (C_PROMOTING_INTEGER_TYPE_P (type))
{
/* Traditionally, unsignedness is preserved in default promotions. */
if ((flag_traditional && TREE_UNSIGNED (type))
/* Also preserve unsignedness if not really getting any wider. */
|| (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node)))
/* Traditionally, unsignedness is preserved in default promotions.
Also preserve unsignedness if not really getting any wider. */
if (TREE_UNSIGNED (type)
&& (flag_traditional
|| TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node)))
return convert (unsigned_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