diff options
author | Richard Stallman <rms@gnu.org> | 1992-07-23 06:05:23 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1992-07-23 06:05:23 +0000 |
commit | d627ed1b71824b574ec653b2c97f60c33fd66acc (patch) | |
tree | ea0fcf557aa83cb423b2d584841b72cd2814eca1 /gcc | |
parent | 674c724c646a60c166d5c2f4389abb52cf6f7f45 (diff) | |
download | gcc-d627ed1b71824b574ec653b2c97f60c33fd66acc.zip gcc-d627ed1b71824b574ec653b2c97f60c33fd66acc.tar.gz gcc-d627ed1b71824b574ec653b2c97f60c33fd66acc.tar.bz2 |
(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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-typeck.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 7b93429..ec984d4 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -601,12 +601,13 @@ self_promoting_args_p (parms) if (TREE_CHAIN (t) == 0 && type != void_type_node) return 0; + if (type == 0) + return 0; + if (TYPE_MAIN_VARIANT (type) == float_type_node) return 0; - if (type - && TREE_CODE (type) == INTEGER_TYPE - && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)) + if (C_PROMOTING_INTEGER_TYPE_P (type)) return 0; } return 1; @@ -621,8 +622,7 @@ self_promoting_type_p (type) if (TYPE_MAIN_VARIANT (type) == float_type_node) return 0; - if (TREE_CODE (type) == INTEGER_TYPE - && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)) + if (C_PROMOTING_INTEGER_TYPE_P (type)) return 0; return 1; @@ -908,12 +908,12 @@ default_conversion (exp) return convert (type, exp); } - if (code == INTEGER_TYPE - && (TYPE_PRECISION (type) - < TYPE_PRECISION (integer_type_node))) + if (C_PROMOTING_INTEGER_TYPE_P (type)) { /* 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 (integer_type_node, exp); } |