Index: fold-const.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v retrieving revision 1.623 diff -u -p -r1.623 fold-const.c --- fold-const.c 24 Aug 2005 07:53:42 -0000 1.623 +++ fold-const.c 29 Aug 2005 04:26:08 -0000 @@ -6633,6 +6633,12 @@ fold_unary (enum tree_code code, tree ty case FIX_ROUND_EXPR: if (TREE_TYPE (op0) == type) return op0; + + /* If we have (type) (a CMP b) and type is an integal type, return + new expression involving the new type. */ + if (COMPARISON_CLASS_P (op0) && INTEGRAL_TYPE_P (type)) + return fold_build2 (TREE_CODE (op0), type, TREE_OPERAND (op0, 0), + TREE_OPERAND (op0, 1)); /* Handle cases of two conversions in a row. */ if (TREE_CODE (op0) == NOP_EXPR