OSDN Git Service

PR c/48742
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Apr 2011 07:05:54 +0000 (07:05 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Apr 2011 07:05:54 +0000 (07:05 +0000)
* c-typeck.c (build_binary_op): Don't wrap arguments if
int_operands is true.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@173012 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 11ff008..d918080 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  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/48768
index fca369c..6ae9b4c 100644 (file)
@@ -10178,7 +10178,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 45bf3e6..c49ca1b 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));
+}