+2008-12-23 Andrew Pinski <pinski@gmail.com>
+
+ PR middle-end/38590
+ * fold-const.c (fold_binary): Call fold_convert on arguments to
+ fold_build2 for negative divide optimization.
+
2008-12-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/31150
WARN_STRICT_OVERFLOW_MISC);
return fold_build2 (code, type,
fold_convert (type, TREE_OPERAND (arg0, 0)),
- negate_expr (arg1));
+ fold_convert (type, negate_expr (arg1)));
}
if ((!INTEGRAL_TYPE_P (type) || TYPE_OVERFLOW_UNDEFINED (type))
&& TREE_CODE (arg1) == NEGATE_EXPR
"when distributing negation across "
"division"),
WARN_STRICT_OVERFLOW_MISC);
- return fold_build2 (code, type, negate_expr (arg0),
- TREE_OPERAND (arg1, 0));
+ return fold_build2 (code, type,
+ fold_convert (type, negate_expr (arg0)),
+ fold_convert (type, TREE_OPERAND (arg1, 0)));
}
/* If arg0 is a multiple of arg1, then rewrite to the fastest div
+2008-12-23 Andrew Pinski <pinskia@gmail.com>
+
+ PR middle-end/38590
+ * gcc.c-torture/compile/pr38590-1.c: New testcase.
+ * gcc.c-torture/compile/pr38590-2.c: New testcase.
+
2008-12-18 Jakub Jelinek <jakub@redhat.com>
PR middle-end/31150