+2015-09-16 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/67442
+ * fold-const.c (extract_muldiv_1): Properly extend multiplication
+ result before builting a tree via wide_int_to_tree.
+
2015-09-16 Mikhail Maltsev <maltsevm@gmail.com>
* Makefile.in: Add memory-block.cc
&& ((sign == UNSIGNED && tcode != MULT_EXPR) || sign == SIGNED))
overflow_p = true;
if (!overflow_p)
- return fold_build2 (tcode, ctype, fold_convert (ctype, op0),
- wide_int_to_tree (ctype, mul));
+ {
+ mul = wide_int::from (mul, TYPE_PRECISION (ctype),
+ TYPE_SIGN (TREE_TYPE (op1)));
+ return fold_build2 (tcode, ctype, fold_convert (ctype, op0),
+ wide_int_to_tree (ctype, mul));
+ }
}
/* If these operations "cancel" each other, we have the main
+2015-09-16 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/67442
+ * gcc.dg/torture/pr67442.c: New testcase.
+
2015-09-15 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/array24.adb: New test.