From 2d1ac15a6abfe3cf5cd6ee92a3d8960bd9fb1af8 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 4 May 2016 22:44:40 +0200 Subject: 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 --- gcc/fold-const.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/fold-const.c') diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 416ec5d..9ef43bf 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -2758,8 +2758,8 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags) if (arg0 != arg1) { inchash::hash hstate0 (0), hstate1 (0); - inchash::add_expr (arg0, hstate0, flags); - inchash::add_expr (arg1, hstate1, flags); + inchash::add_expr (arg0, hstate0, flags | OEP_HASH_CHECK); + inchash::add_expr (arg1, hstate1, flags | OEP_HASH_CHECK); hashval_t h0 = hstate0.end (); hashval_t h1 = hstate1.end (); gcc_assert (h0 == h1); -- cgit v1.1