re PR bootstrap/68346 (Bootstrap failure on i686-linux)
authorJason Merrill <jason@redhat.com>
Sat, 14 Nov 2015 18:54:16 +0000 (13:54 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 14 Nov 2015 18:54:16 +0000 (13:54 -0500)
PR bootstrap/68346
* call.c (build_new_op_1): Don't fold arguments to
warn_tautological_cmp.

From-SVN: r230382

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/g++.dg/warn/Wtautological-compare.C [new file with mode: 0644]

index baaabc8761f77c626aa11dda15ce8977cc17afd1..b154453dde1240ec0a07f5ef97fe01cf8794b90f 100644 (file)
@@ -1,3 +1,9 @@
+2015-11-14  Jason Merrill  <jason@redhat.com>
+
+       PR bootstrap/68346
+       * call.c (build_new_op_1): Don't fold arguments to
+       warn_tautological_cmp.
+
 2015-11-14  Jakub Jelinek  <jakub@redhat.com>
 
        * semantics.c (finish_omp_clauses): Don't mark
index 77c29366b1351c1cd93e2c09717f9ef5e1cd3179..8cdda6200e18685556423403fe7e632b1037e7fd 100644 (file)
@@ -5741,7 +5741,7 @@ build_new_op_1 (location_t loc, enum tree_code code, int flags, tree arg1,
        maybe_warn_bool_compare (loc, code, fold (arg1),
                                 fold (arg2));
       if (complain & tf_warning && warn_tautological_compare)
-       warn_tautological_cmp (loc, code, fold (arg1), fold (arg2));
+       warn_tautological_cmp (loc, code, arg1, arg2);
       /* Fall through.  */
     case PLUS_EXPR:
     case MINUS_EXPR:
diff --git a/gcc/testsuite/g++.dg/warn/Wtautological-compare.C b/gcc/testsuite/g++.dg/warn/Wtautological-compare.C
new file mode 100644 (file)
index 0000000..451fd54
--- /dev/null
@@ -0,0 +1,7 @@
+// PR bootstrap/68346
+// { dg-options -Wtautological-compare }
+
+bool f(unsigned u)
+{
+  return ((unsigned)(int)u == u);
+}