aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-04-29 00:23:01 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-04-29 00:23:01 +0200
commit8b80cc2131a7eb179a75392656b753d51045fb19 (patch)
tree8377c737763a3df6594340ecbe12fc8605d2c3f5 /gcc/tree.c
parent9f405ce1b5bc4befcc4c2ac482e92f1662131659 (diff)
downloadgcc-8b80cc2131a7eb179a75392656b753d51045fb19.zip
gcc-8b80cc2131a7eb179a75392656b753d51045fb19.tar.gz
gcc-8b80cc2131a7eb179a75392656b753d51045fb19.tar.bz2
re PR middle-end/70843 (ICE in add_expr, at tree.c:7913)
PR middle-end/70843 * fold-const.c (operand_equal_p): Don't verify hash value equality if arg0 == arg1. * tree.c (inchash::add_expr): Handle STATEMENT_LIST. Ignore BLOCK and OMP_CLAUSE. * gcc.dg/pr70843.c: New test. From-SVN: r235615
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 8692182..8ec2d5c 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -7836,6 +7836,10 @@ add_expr (const_tree t, inchash::hash &hstate, unsigned int flags)
case PLACEHOLDER_EXPR:
/* The node itself doesn't matter. */
return;
+ case BLOCK:
+ case OMP_CLAUSE:
+ /* Ignore. */
+ return;
case TREE_LIST:
/* A list of expressions, for a CALL_EXPR or as the elements of a
VECTOR_CST. */
@@ -7854,6 +7858,14 @@ add_expr (const_tree t, inchash::hash &hstate, unsigned int flags)
}
return;
}
+ case STATEMENT_LIST:
+ {
+ tree_stmt_iterator i;
+ for (i = tsi_start (CONST_CAST_TREE (t));
+ !tsi_end_p (i); tsi_next (&i))
+ inchash::add_expr (tsi_stmt (i), hstate, flags);
+ return;
+ }
case FUNCTION_DECL:
/* When referring to a built-in FUNCTION_DECL, use the __builtin__ form.
Otherwise nodes that compare equal according to operand_equal_p might