aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2005-08-01 01:29:06 +0000
committerJoseph Myers <joseph@codesourcery.com>2005-08-01 01:29:06 +0000
commit8aae3e4e7d0ebf8caf50c920a8c7ea987ef59489 (patch)
tree1fc25d7b6ae7a46e921daa5b71cd0b9af00e1eeb /gcc/c-typeck.c
parente488e99f3781e9af3fa175d8b091b5501db2729a (diff)
PR c/22311
* c-typeck.c (build_binary_op): Use common_type wrapper on shortened types. (common_type): Update comment. testsuite: * gcc.dg/pr22311-1.c : New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@102615 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r--gcc/c-typeck.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index eb7909ed769..c0498955f08 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -637,7 +637,8 @@ c_common_type (tree t1, tree t2)
return t2;
}
-/* Wrapper around c_common_type that is used by c-common.c. ENUMERAL_TYPEs
+/* Wrapper around c_common_type that is used by c-common.c and other
+ front end optimizations that remove promotions. ENUMERAL_TYPEs
are allowed here and are converted to their compatible integer types.
BOOLEAN_TYPEs are allowed here and return either boolean_type_node or
preferably a non-Boolean type as the common type. */
@@ -7948,7 +7949,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
&& (unsigned0 || !uns))
result_type
= c_common_signed_or_unsigned_type
- (unsigned0, c_common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)));
+ (unsigned0, common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)));
else if (TREE_CODE (arg0) == INTEGER_CST
&& (unsigned1 || !uns)
&& (TYPE_PRECISION (TREE_TYPE (arg1))