re PR middle-end/34070 (Wrong code for (int)x%4)
authorRichard Guenther <rguenther@suse.de>
Mon, 12 Nov 2007 14:16:05 +0000 (14:16 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 12 Nov 2007 14:16:05 +0000 (14:16 +0000)
commit916c75b4739db757d1e820be5ba3699848505179
treefb294631ce72ef4c2afc3cd1f59f93a16cf0896a
parent65648dd47e35451645d3f2fb2cdcd02cf43e1d87
re PR middle-end/34070 (Wrong code for (int)x%4)

2007-11-12  Richard Guenther  <rguenther@suse.de>

PR middle-end/34070
* fold-const.c (fold_binary): If testing for non-negative
operands with tree_expr_nonnegative_warnv_p make sure to
use op0 which has all (sign) conversions retained.

* gcc.c-torture/execute/pr34070-1.c: New testcase.
* gcc.c-torture/execute/pr34070-2.c: Likewise.

From-SVN: r130098
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr34070-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr34070-2.c [new file with mode: 0644]