------- Comment #11 from ubizjak at gmail dot com 2009-09-21 13:02 ------- Another week, another patch in testing:
Index: c-typeck.c =================================================================== --- c-typeck.c (revision 151915) +++ c-typeck.c (working copy) @@ -9465,6 +9465,7 @@ build_binary_op (location_t location, en unsigned_arg = TYPE_UNSIGNED (TREE_TYPE (op0)); if (TYPE_PRECISION (TREE_TYPE (arg0)) < TYPE_PRECISION (result_type) + && int_fits_type_p (op1, TREE_TYPE (arg0)) /* We can shorten only if the shift count is less than the number of bits in the smaller type size. */ && compare_tree_int (op1, TYPE_PRECISION (TREE_TYPE (arg0))) < 0 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39779