2009-03-06 Richard Guenther <rguenther@suse.de>
commit43f802d18dce3d3aa73fef0330b07549dee223ee
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 6 Mar 2009 12:12:36 +0000 (6 12:12 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 6 Mar 2009 12:12:36 +0000 (6 12:12 +0000)
tree982c3e40a0d0c70979c924d419d2937a7b63986b
parent474f52861b6dd9aa0dd32d1c8d6eae868e4f1c69
2009-03-06  Richard Guenther  <rguenther@suse.de>

* fold-const.c (negate_expr_p): Only do not negate integer
constants if overflows on the type trap and the negation
might overflow.  Remove superfluous TYPE_OVERFLOW_WRAPS checks.
Do not negate divisions on integral types.
(fold_negate_expr): Do not negate divisions on integral types.
(build_range_check): Remove superfluous TYPE_OVERFLOW_WRAPS checks.
(extract_muldiv_1): Likewise.
(fold_unary): Likewise for (T1)(X * Y) to (T1)X * (T1)Y folding.
Adjust folding to also apply to MULTNV_EXPR if NV is dropped
on the result.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/no-undefined-overflow@144669 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog.overflow
gcc/fold-const.c