From 5c2f94b4f51d7bff3ffce905dacd5c5e65995f3c Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 27 Apr 2011 09:04:25 +0200 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/c-typeck.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.c-torture/compile/pr48742.c | 15 +++++++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr48742.c 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)); +} -- 2.30.2