From: Jakub Jelinek Date: Wed, 27 Apr 2011 07:04:25 +0000 (+0200) Subject: re PR c/48742 (Internal error in gimplify_expr) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5c2f94b4f51d7bff3ffce905dacd5c5e65995f3c;p=gcc.git re PR c/48742 (Internal error in gimplify_expr) 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. From-SVN: r173011 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6714b1f5db0..3a358d9d750 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-04-27 Jakub Jelinek + + PR c/48742 + * c-typeck.c (build_binary_op): Don't wrap arguments if + int_operands is true. + 2011-04-26 Kaz Kojima PR target/48767 diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 3849352708c..2f9f1424cd2 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -10190,7 +10190,7 @@ build_binary_op (location_t location, enum tree_code code, 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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f39f7edef7d..19fd6de0cba 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-04-27 Jakub Jelinek + + PR c/48742 + * gcc.c-torture/compile/pr48742.c: New test. + 2011-04-26 Jason Merrill * g++.dg/lookup/koenig13.C: New. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr48742.c b/gcc/testsuite/gcc.c-torture/compile/pr48742.c new file mode 100644 index 00000000000..0a670f3c990 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr48742.c @@ -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)); +}