Commit 7f166b0a by Roger Sayle Committed by Roger Sayle

re PR middle-end/22524 (fold (or the front-ends) produces UNARY (BIT_NOT_EXPR)…

re PR middle-end/22524 (fold (or the front-ends) produces UNARY (BIT_NOT_EXPR) tree with mismatch types)


	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
parent ebf78a47
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> 2006-03-27 Sebastian Pop <pop@cri.ensmp.fr>
* tree-loop-linear.c: Don't include varray.h. * tree-loop-linear.c: Don't include varray.h.
......
...@@ -8186,7 +8186,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) ...@@ -8186,7 +8186,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
if (INTEGRAL_TYPE_P (type) if (INTEGRAL_TYPE_P (type)
&& TREE_CODE (arg0) == NEGATE_EXPR && TREE_CODE (arg0) == NEGATE_EXPR
&& integer_onep (arg1)) && 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. */ /* Convert -1 - A to ~A. */
if (INTEGRAL_TYPE_P (type) if (INTEGRAL_TYPE_P (type)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment