+2015-04-11 Jakub Jelinek <jakub@redhat.com>
+
+ 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.
+
2015-04-11 Gerald Pfeifer <gerald@pfeifer.com>
* doc/contrib.texi (Contributors): Add Ira Rosen.
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)
{
return;
/* Avoid infinite recursion. */
- if (visited_phis->add (def_stmt))
+ if (visited_bbs->add (var_bb))
return;
gphi *phi = as_a <gphi *> (def_stmt);
{
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 ();
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;