Message ID | 20110426174026.GI17079@tyan-ft48-01.lab.bos.redhat.com |
---|---|
State | New |
Headers | show |
On Tue, 26 Apr 2011, Jakub Jelinek wrote: > 2011-04-26 Jakub Jelinek <jakub@redhat.com> > > PR c/48742 > * c-typeck.c (build_binary_op): Don't wrap arguments if > int_operands is true. > > * gcc.c-torture/compile/pr48742.c: New test. OK.
--- gcc/c-typeck.c.jj 2011-04-12 09:37:56.000000000 +0200 +++ gcc/c-typeck.c 2011-04-26 17:10:35.000000000 +0200 @@ -10190,7 +10190,7 @@ build_binary_op (location_t location, en warn_for_sign_compare (location, orig_op0_folded, orig_op1_folded, op0, op1, result_type, resultcode); - if (!in_late_binary_op) + if (!in_late_binary_op && !int_operands) { if (!op0_maybe_const || TREE_CODE (op0) != INTEGER_CST) op0 = c_wrap_maybe_const (op0, !op0_maybe_const); --- gcc/testsuite/gcc.c-torture/compile/pr48742.c.jj 2011-04-26 17:13:12.000000000 +0200 +++ gcc/testsuite/gcc.c-torture/compile/pr48742.c 2011-04-26 17:12:41.000000000 +0200 @@ -0,0 +1,15 @@ +/* PR c/48742 */ + +void baz (int); + +int +foo (void) +{ + return 1 / 0 > 0; +} + +void +bar (void) +{ + baz (1 <= 2 % (3 >> 1 > 5 / 6 == 3)); +}