From e83d45c45e9155cb449b3ce70afabc175b572d29 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Fri, 7 Aug 1992 07:21:41 +0000 Subject: [PATCH] (default_conversion): Fix bug that promotes short to unsigned if sizeof(short) == sizeof(int). From-SVN: r1784 --- gcc/c-typeck.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 52c3c211750..0cd4bff7e01 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -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); } -- 2.30.2