PR middle-end/22524
* fold-const.c (fold_binary) <MINUS_EXPR>: Call fold_convert to
cast BIT_NOT_EXPR operand to the correct type.
From-SVN: r112438
+2006-03-27 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/22524
+ * fold-const.c (fold_binary) <MINUS_EXPR>: Call fold_convert to
+ cast BIT_NOT_EXPR operand to the correct type.
+
2006-03-27 Sebastian Pop <pop@cri.ensmp.fr>
* tree-loop-linear.c: Don't include varray.h.
if (INTEGRAL_TYPE_P (type)
&& TREE_CODE (arg0) == NEGATE_EXPR
&& integer_onep (arg1))
- return fold_build1 (BIT_NOT_EXPR, type, TREE_OPERAND (arg0, 0));
+ return fold_build1 (BIT_NOT_EXPR, type,
+ fold_convert (type, TREE_OPERAND (arg0, 0)));
/* Convert -1 - A to ~A. */
if (INTEGRAL_TYPE_P (type)