aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-02-17 23:27:24 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2016-02-17 23:27:24 +0100
commit932c0da42d36625559d7997b392b0d08869dc649 (patch)
treeb906ddcc4aab6686c41e92f405908b6c5569564d /gcc/gimplify.c
parent0f02dd56f5f50238244a729bde63387d42c36d63 (diff)
downloadgcc-932c0da42d36625559d7997b392b0d08869dc649.zip
gcc-932c0da42d36625559d7997b392b0d08869dc649.tar.gz
gcc-932c0da42d36625559d7997b392b0d08869dc649.tar.bz2
re PR c++/69850 (unnecessary -Wnonnull-compare warning)
PR c++/69850 * gimplify.c (gimplify_cond_expr): Call gimple_set_no_warning on the cond_stmt from TREE_NO_WARNING on COND_EXPR_COND. * gimple-ssa-nonnull-compare.c (do_warn_nonnull_compare): Don't warn on gimple_no_warning_p statements. * init.c (build_delete): Set TREE_NO_WARNING on ifexp. * g++.dg/warn/Wnonnull-compare-1.C: New test. From-SVN: r233508
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 6aa9db2..7be6bd7 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -3219,6 +3219,7 @@ gimplify_cond_expr (tree *expr_p, gimple_seq *pre_p, fallback_t fallback)
&arm2);
cond_stmt = gimple_build_cond (pred_code, arm1, arm2, label_true,
label_false);
+ gimple_set_no_warning (cond_stmt, TREE_NO_WARNING (COND_EXPR_COND (expr)));
gimplify_seq_add_stmt (&seq, cond_stmt);
gimple_stmt_iterator gsi = gsi_last (seq);
maybe_fold_stmt (&gsi);