aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-03-22 09:11:14 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2016-03-22 09:11:14 +0100
commit4cde512c84dfc20a95a01cca838f288e3015cab5 (patch)
treed016a7c98c2d31dc41b4d4e32a217406c416f094 /gcc/gimplify.c
parent16f6d7dc5c11b0b91aad24b6975dfa77d8e84b6f (diff)
downloadgcc-4cde512c84dfc20a95a01cca838f288e3015cab5.zip
gcc-4cde512c84dfc20a95a01cca838f288e3015cab5.tar.gz
gcc-4cde512c84dfc20a95a01cca838f288e3015cab5.tar.bz2
re PR c++/70295 (bogus -Wnonnull-compare for "dynamic_cast<const FuSelection *>(this) != nullptr")
PR c++/70295 * gimplify.c (gimplify_modify_expr): Call gimple_set_no_warning on assign if (*from_p) is a comparison, set it to TREE_NO_WARNING (*from_p). * c-c++-common/nonnull-1.c (func): Remove parens around cp4 != 0. (func2): New function for cond with parens, xfail warning for c++. * g++.dg/warn/Wnonnull-compare-8.C: New test. From-SVN: r234392
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 3687e7a..5d03435 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4850,6 +4850,8 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
{
assign = gimple_build_assign (*to_p, *from_p);
gimple_set_location (assign, EXPR_LOCATION (*expr_p));
+ if (COMPARISON_CLASS_P (*from_p))
+ gimple_set_no_warning (assign, TREE_NO_WARNING (*from_p));
}
if (gimplify_ctxp->into_ssa && is_gimple_reg (*to_p))