+2013-05-14 Marc Glisse <marc.glisse@inria.fr>
+
+ PR bootstrap/57266
+ * fold-const.c (fold_binary_loc) <shift>: Use an unsigned
+ variable for the shift amount. Check that we shift by non-negative
+ amounts.
+
2013-05-14 Chung-Lin Tang <cltang@codesourcery.com>
PR target/42017
prec = element_precision (type);
/* Turn (a OP c1) OP c2 into a OP (c1+c2). */
- if (TREE_CODE (op0) == code && host_integerp (arg1, false)
+ if (TREE_CODE (op0) == code && host_integerp (arg1, true)
&& TREE_INT_CST_LOW (arg1) < prec
- && host_integerp (TREE_OPERAND (arg0, 1), false)
+ && host_integerp (TREE_OPERAND (arg0, 1), true)
&& TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1)) < prec)
{
- HOST_WIDE_INT low = (TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1))
- + TREE_INT_CST_LOW (arg1));
+ unsigned int low = (TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1))
+ + TREE_INT_CST_LOW (arg1));
/* Deal with a OP (c1 + c2) being undefined but (a OP c1) OP c2
being well defined. */