aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-05-04 22:44:40 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-05-04 22:44:40 +0200
commit2d1ac15a6abfe3cf5cd6ee92a3d8960bd9fb1af8 (patch)
treec73a1cb4d2e0eead0a6bf4402be2850902e37cab /gcc/tree.c
parente4ea422a005d67594f66a8986d930f623c46b200 (diff)
downloadgcc-2d1ac15a6abfe3cf5cd6ee92a3d8960bd9fb1af8.zip
gcc-2d1ac15a6abfe3cf5cd6ee92a3d8960bd9fb1af8.tar.gz
gcc-2d1ac15a6abfe3cf5cd6ee92a3d8960bd9fb1af8.tar.bz2
re PR c++/70906 (ice in add_expr, at tree.c:7925)
PR c++/70906 PR c++/70933 * tree-core.h (enum operand_equal_flag): Add OEP_HASH_CHECK. * tree.c (inchash::add_expr): If !IS_EXPR_CODE_CLASS (tclass), assert flags & OEP_HASH_CHECK, instead of asserting it never happens. Handle TARGET_EXPR. * fold-const.c (operand_equal_p): For hash verification, or in OEP_HASH_CHECK into flags. * g++.dg/opt/pr70906.C: New test. * g++.dg/opt/pr70933.C: New test. From-SVN: r235902
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index ebec112..c565337 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -7915,9 +7915,12 @@ add_expr (const_tree t, inchash::hash &hstate, unsigned int flags)
&& integer_zerop (TREE_OPERAND (t, 1)))
inchash::add_expr (TREE_OPERAND (TREE_OPERAND (t, 0), 0),
hstate, flags);
+ /* Don't ICE on FE specific trees, or their arguments etc.
+ during operand_equal_p hash verification. */
+ else if (!IS_EXPR_CODE_CLASS (tclass))
+ gcc_assert (flags & OEP_HASH_CHECK);
else
{
- gcc_assert (IS_EXPR_CODE_CLASS (tclass));
unsigned int sflags = flags;
hstate.add_object (code);
@@ -7966,6 +7969,13 @@ add_expr (const_tree t, inchash::hash &hstate, unsigned int flags)
hstate.add_int (CALL_EXPR_IFN (t));
break;
+ case TARGET_EXPR:
+ /* For TARGET_EXPR, just hash on the TARGET_EXPR_SLOT.
+ Usually different TARGET_EXPRs just should use
+ different temporaries in their slots. */
+ inchash::add_expr (TARGET_EXPR_SLOT (t), hstate, flags);
+ return;
+
default:
break;
}