------- Comment #5 from pinskia at gcc dot gnu dot org 2007-07-18 14:16 ------- Patch which needs testing: Index: c-typeck.c =================================================================== --- c-typeck.c (revision 126719) +++ c-typeck.c (working copy) @@ -8218,8 +8239,9 @@ < TYPE_PRECISION (result_type)) && (type = c_common_signed_or_unsigned_type (unsigned1, - TREE_TYPE (arg1)), - int_fits_type_p (arg0, type))) + TREE_TYPE (arg1))) + && !POINTER_TYPE_P (type) + && int_fits_type_p (arg0, type)) result_type = type; else if (TREE_CODE (arg1) == INTEGER_CST && (unsigned0 || !uns) @@ -8227,8 +8249,9 @@ < TYPE_PRECISION (result_type)) && (type = c_common_signed_or_unsigned_type (unsigned0, - TREE_TYPE (arg0)), - int_fits_type_p (arg1, type))) + TREE_TYPE (arg0))) + && !POINTER_TYPE_P (type) + && int_fits_type_p (arg0, type)) result_type = type; }
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32796