]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c/48742 (Internal error in gimplify_expr)
authorJakub Jelinek <jakub@redhat.com>
Tue, 3 May 2011 16:34:32 +0000 (18:34 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 3 May 2011 16:34:32 +0000 (18:34 +0200)
Backport from mainline
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.

* gcc.c-torture/compile/pr48742.c: New test.

From-SVN: r173326

gcc/ChangeLog
gcc/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr48742.c [new file with mode: 0644]

index a67888f9965f59e4886931f49341b0e12ccd7eef..1e4307dc13d37ea8113b0bf74b83a2c3d7089f33 100644 (file)
@@ -1,6 +1,12 @@
 2011-05-03  Jakub Jelinek  <jakub@redhat.com>
 
        Backport from mainline
+       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-23  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/48685
index 92b0f618f0b93a84322a8532e3f735e89d576744..e1ba16b1fe1f625de659fdf4c858358464160e0a 100644 (file)
@@ -9800,7 +9800,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 0bacbf0c652b007a570ace0a241c4764aecc3d91..0b6e8e92f6cb58278e883def0270bce4ffcbe1cb 100644 (file)
@@ -1,6 +1,11 @@
 2011-05-03  Jakub Jelinek  <jakub@redhat.com>
 
        Backport from mainline
+       2011-04-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/48742
+       * gcc.c-torture/compile/pr48742.c: New test.
+
        2011-04-23  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/48685
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));
+}