https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111293
--- Comment #4 from Mikael Morin <mikael at gcc dot gnu.org> ---
For what's worth adding -fno-tree-vrp "fixes" this and enables removal of the
call to 'foo' with trunk.
Here is a minimal revert of the regressing revision, but it may just make the
problem latent.
diff --git a/gcc/gimple-range-phi.cc b/gcc/gimple-range-phi.cc
index 01900a35b32..9fa9fe83ce0 100644
--- a/gcc/gimple-range-phi.cc
+++ b/gcc/gimple-range-phi.cc
@@ -386,14 +386,6 @@ phi_analyzer::process_phi (gphi *phi)
m_work.safe_push (arg);
continue;
}
- // More than 2 outside names is too complicated.
- if (m_num_extern >= 2)
- {
- cycle_p = false;
- break;
- }
- m_external[m_num_extern] = arg;
- m_ext_edge[m_num_extern++] = gimple_phi_arg_edge (phi_stmt, x);
}
else if (code == INTEGER_CST)
{
@@ -402,12 +394,15 @@ phi_analyzer::process_phi (gphi *phi)
wi::to_wide (arg));
init_range.union_ (val);
}
- else
+ // More than 2 outside names/CONST is too complicated.
+ if (m_num_extern >= 2)
{
- // Everything else terminates the cycle.
cycle_p = false;
break;
}
+
+ m_external[m_num_extern] = arg;
+ m_ext_edge[m_num_extern++] = gimple_phi_arg_edge (phi_stmt, x);
}
}