+2016-03-30 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/70450
+ * fold-const.c (extract_muldiv_1): Fix thinko in wide_int::from
+ usage.
+
2016-03-30 Jakub Jelinek <jakub@redhat.com>
PR target/70421
bool overflow_mul_p;
signop sign = TYPE_SIGN (ctype);
unsigned prec = TYPE_PRECISION (ctype);
- wide_int mul = wi::mul (wide_int::from (op1, prec, sign),
- wide_int::from (c, prec, sign),
+ wide_int mul = wi::mul (wide_int::from (op1, prec,
+ TYPE_SIGN (TREE_TYPE (op1))),
+ wide_int::from (c, prec,
+ TYPE_SIGN (TREE_TYPE (c))),
sign, &overflow_mul_p);
overflow_p = TREE_OVERFLOW (c) | TREE_OVERFLOW (op1);
if (overflow_mul_p
--- /dev/null
+/* { dg-do run } */
+/* { dg-require-effective-target lp64 } */
+
+unsigned long int a = 2UL;
+int b = 2;
+unsigned long int c = 2UL;
+
+void foo ()
+{
+ c = 2 * ((2 * a) * (2 * (-b)));
+}
+
+int main ()
+{
+ foo();
+ if (c != 18446744073709551584UL)
+ __builtin_abort();
+ return 0;
+}