re PR c/48742 (Internal error in gimplify_expr)
authorJakub Jelinek <jakub@redhat.com>
Wed, 27 Apr 2011 07:04:25 +0000 (09:04 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 27 Apr 2011 07:04:25 +0000 (09:04 +0200)
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
gcc/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr48742.c [new file with mode: 0644]

index 6714b1f..3a358d9 100644 (file)
@@ -1,3 +1,9 @@
+2011-04-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/48742
+       * c-typeck.c (build_binary_op): Don't wrap arguments if
+       int_operands is true.
+
 2011-04-26  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        PR target/48767
index 3849352..2f9f142 100644 (file)
@@ -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);
index f39f7ed..19fd6de 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/48742
+       * gcc.c-torture/compile/pr48742.c: New test.
+
 2011-04-26  Jason Merrill  <jason@redhat.com>
 
        * 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 (file)
index 0000000..0a670f3
--- /dev/null
@@ -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));
+}