There's no point in walking through the PHIs to trace values for
SSA_NAMEs that appear in abnormal PHIs -- we're not supposed to be
threading those paths to begin with.
This happens to avoid a lot of useless work for BZ 69347.
Bootstrapped and regression tested on x86. Committed to the trunk.
Jeff
ps. There's still a significant size regression with the FSM threader,
this patch shouldn't impact that BZ.
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f41b2c6..2930a8f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2016-01-19 Jeff Law <l...@redhat.com>
+
+ PR middle-end/69347
+ * tree-ssa-threadbackwards.c
+ (fsm_find_control_statement_thread_paths): Do not try to lookup
+ FSM paths for SSA_NAMEs appearing in abnormal PHIs.
+
2016-01-20 Kugan Vivekanandarajah <kug...@linaro.org>
* doc/lto.texi: Remove text that says only Gold has linker plugin
diff --git a/gcc/tree-ssa-threadbackward.c b/gcc/tree-ssa-threadbackward.c
index 8c99f6f..8d8aa30 100644
--- a/gcc/tree-ssa-threadbackward.c
+++ b/gcc/tree-ssa-threadbackward.c
@@ -99,6 +99,11 @@ fsm_find_control_statement_thread_paths (tree name,
vec<basic_block, va_gc> *&path,
bool seen_loop_phi)
{
+ /* If NAME appears in an abnormal PHI, then don't try to trace its
+ value back through PHI nodes. */
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name))
+ return;
+
gimple *def_stmt = SSA_NAME_DEF_STMT (name);
basic_block var_bb = gimple_bb (def_stmt);