+2005-08-01 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR c/22311
+ * c-typeck.c (build_binary_op): Use common_type wrapper on
+ shortened types.
+ (common_type): Update comment.
+
2005-07-31 Steven Bosscher <stevenb@suse.de>
PR target/23095
return t2;
}
\f
-/* 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. */
&& (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))
--- /dev/null
+/* Bug 22311: ICE with -fshort-enums on shortened operations. */
+/* { dg-do compile } */
+/* { dg-options "-fshort-enums" } */
+
+typedef enum { A = 1 } E;
+void f(E e, unsigned char c) { c |= e; }