From 38e5f0454c22a422f0aa2e5f2ec2962baa6427ab Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 14 Nov 2015 13:54:16 -0500 Subject: [PATCH] re PR bootstrap/68346 (Bootstrap failure on i686-linux) PR bootstrap/68346 * call.c (build_new_op_1): Don't fold arguments to warn_tautological_cmp. From-SVN: r230382 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/call.c | 2 +- gcc/testsuite/g++.dg/warn/Wtautological-compare.C | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/warn/Wtautological-compare.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index baaabc8761f..b154453dde1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-11-14 Jason Merrill + + PR bootstrap/68346 + * call.c (build_new_op_1): Don't fold arguments to + warn_tautological_cmp. + 2015-11-14 Jakub Jelinek * semantics.c (finish_omp_clauses): Don't mark diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 77c29366b13..8cdda6200e1 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -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 index 00000000000..451fd54850d --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wtautological-compare.C @@ -0,0 +1,7 @@ +// PR bootstrap/68346 +// { dg-options -Wtautological-compare } + +bool f(unsigned u) +{ + return ((unsigned)(int)u == u); +} -- 2.30.2