aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/cp-gimplify.c3
-rw-r--r--gcc/cp/init.c13
3 files changed, 18 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 12a3967..dbc6741 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,12 @@
2016-02-19 Jakub Jelinek <jakub@redhat.com>
+ PR c++/69850
+ * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
+ condition.
+ * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
+ operators if folding preserved the binop, just with different
+ arguments.
+
PR c++/67767
* parser.c (cp_parser_std_attribute_spec_seq): Don't assume
attr_spec is always single element chain, chain all the attributes
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index d83e9de..34bdc82 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -2068,6 +2068,9 @@ cp_fold (tree x)
else
x = fold (x);
+ if (TREE_NO_WARNING (org_x)
+ && TREE_CODE (x) == TREE_CODE (org_x))
+ TREE_NO_WARNING (x) = 1;
break;
case VEC_COND_EXPR:
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 68cc1a7..19279e3 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -3678,12 +3678,15 @@ build_vec_delete_1 (tree base, tree maxindex, tree type,
body = integer_zero_node;
/* Outermost wrapper: If pointer is null, punt. */
+ tree cond
+ = fold_build2_loc (input_location, NE_EXPR, boolean_type_node, base,
+ fold_convert (TREE_TYPE (base), nullptr_node));
+ /* This is a compiler generated comparison, don't emit
+ e.g. -Wnonnull-compare warning for it. */
+ if (TREE_CODE (cond) == NE_EXPR)
+ TREE_NO_WARNING (cond) = 1;
body = fold_build3_loc (input_location, COND_EXPR, void_type_node,
- fold_build2_loc (input_location,
- NE_EXPR, boolean_type_node, base,
- fold_convert (TREE_TYPE (base),
- nullptr_node)),
- body, integer_zero_node);
+ cond, body, integer_zero_node);
body = build1 (NOP_EXPR, void_type_node, body);
if (controller)