summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadedge.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-04-11 19:32:54 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2015-04-11 19:32:54 +0200
commite9329eb5869ee50d448ddd40489314e47363c02a (patch)
treed0aea9c90c9f68ddc9d3b8158f8c669005edd1b5 /gcc/tree-ssa-threadedge.c
parentbc7e7ed3e350ea14c1c4e6432c8c1fb19b3c0668 (diff)
re PR middle-end/65735 (ICE (in duplicate_thread_path, at tree-ssa-threadupdate.c))
PR tree-optimization/65735 * tree-ssa-threadedge.c (fsm_find_control_statement_thread_paths): Remove visited_phis argument, add visited_bbs, avoid recursing into the same bb rather than just into the same phi node. (thread_through_normal_block): Adjust caller. * gcc.c-torture/compile/pr65735.c: New test. From-SVN: r222011
Diffstat (limited to 'gcc/tree-ssa-threadedge.c')
-rw-r--r--gcc/tree-ssa-threadedge.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index 7187d065e91..90c1e2af94a 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -1015,7 +1015,7 @@ static int max_threaded_paths;
static void
fsm_find_control_statement_thread_paths (tree expr,
- hash_set<gimple> *visited_phis,
+ hash_set<basic_block> *visited_bbs,
vec<basic_block, va_gc> *&path,
bool seen_loop_phi)
{
@@ -1034,7 +1034,7 @@ fsm_find_control_statement_thread_paths (tree expr,
return;
/* Avoid infinite recursion. */
- if (visited_phis->add (def_stmt))
+ if (visited_bbs->add (var_bb))
return;
gphi *phi = as_a <gphi *> (def_stmt);
@@ -1109,7 +1109,7 @@ fsm_find_control_statement_thread_paths (tree expr,
{
vec_safe_push (path, bbi);
/* Recursively follow SSA_NAMEs looking for a constant definition. */
- fsm_find_control_statement_thread_paths (arg, visited_phis, path,
+ fsm_find_control_statement_thread_paths (arg, visited_bbs, path,
seen_loop_phi);
path->pop ();
@@ -1391,13 +1391,13 @@ thread_through_normal_block (edge e,
vec<basic_block, va_gc> *bb_path;
vec_alloc (bb_path, n_basic_blocks_for_fn (cfun));
vec_safe_push (bb_path, e->dest);
- hash_set<gimple> *visited_phis = new hash_set<gimple>;
+ hash_set<basic_block> *visited_bbs = new hash_set<basic_block>;
max_threaded_paths = PARAM_VALUE (PARAM_MAX_FSM_THREAD_PATHS);
- fsm_find_control_statement_thread_paths (cond, visited_phis, bb_path,
+ fsm_find_control_statement_thread_paths (cond, visited_bbs, bb_path,
false);
- delete visited_phis;
+ delete visited_bbs;
vec_free (bb_path);
}
return 0;