I increment the index variable in a loop even when I do
vec::unordered_remove() which causes the vector traversal to miss some
elements. Mikael notified me of this mistake I made in my last patch.
gcc/ChangeLog:
* gimple-ssa-sccopy.cc (scc_copy_prop::propagate): Don't
increment after vec::unordered_remove().
Reported-by: Mikael Morin <mikael@gcc.gnu.org>
Signed-off-by: Filip Kastl <fkastl@suse.cz>
get removed. That means parts of CFG get removed. Those may
contain copy statements. For that reason we prune SCCs here. */
unsigned i;
- for (i = 0; i < scc.length (); i++)
+ for (i = 0; i < scc.length ();)
if (gimple_bb (scc[i]) == NULL)
scc.unordered_remove (i);
+ else
+ i++;
if (scc.is_empty ())
{
scc.release ();