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