+2009-05-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/40204
+ * fold-const.c (fold_binary) <case BIT_AND_EXPR>: Avoid infinite
+ recursion if build_int_cst_type returns the same INTEGER_CST as
+ arg1.
+
2009-05-20 Eric Botcazou <ebotcazou@adacore.com>
* fold-const.c (build_fold_addr_expr_with_type): Take the address of
if (prec < HOST_BITS_PER_WIDE_INT
|| newmask == ~(unsigned HOST_WIDE_INT) 0)
{
+ tree newmaskt;
+
if (shift_type != TREE_TYPE (arg0))
{
tem = fold_build2 (TREE_CODE (arg0), shift_type,
}
else
tem = op0;
- return fold_build2 (BIT_AND_EXPR, type, tem,
- build_int_cst_type (TREE_TYPE (op1),
- newmask));
+ newmaskt = build_int_cst_type (TREE_TYPE (op1), newmask);
+ if (!tree_int_cst_equal (newmaskt, arg1))
+ return fold_build2 (BIT_AND_EXPR, type, tem, newmaskt);
}
}
}
+2009-05-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/40204
+ * gcc.c-torture/compile/pr40204.c: New test.
+
2009-05-20 Richard Guenther <rguenther@suse.de>
* gcc.c-torture/compile/20090518-1.c: New testcase.