+2015-08-03 Jeff Law <law@redhat.com>
+
+ PR middle-end/66314
+ PR gcov-profile/66899
+ * tree-ssa-threadupdate.c (mark_threaded_blocks): Correctly
+ iterate over the jump threading paths when an element in the
+ jump threading paths array is eliminated.
+
2015-08-03 Segher Boessenkool <segher@kernel.crashing.org>
* Makefile.in (OBJS): Put gimple-match.o and generic-match.o first.
cases where the second path starts at a downstream edge on the same
path). First record all joiner paths, deleting any in the unexpected
case where there is already a path for that incoming edge. */
- for (i = 0; i < paths.length (); i++)
+ for (i = 0; i < paths.length ();)
{
vec<jump_thread_edge *> *path = paths[i];
if ((*path)[0]->e->aux == NULL)
{
(*path)[0]->e->aux = path;
+ i++;
}
else
{
delete_jump_thread_path (path);
}
}
+ else
+ {
+ i++;
+ }
}
+
/* Second, look for paths that have any other jump thread attached to
them, and either finish converting them or cancel them. */
- for (i = 0; i < paths.length (); i++)
+ for (i = 0; i < paths.length ();)
{
vec<jump_thread_edge *> *path = paths[i];
edge e = (*path)[0]->e;
/* If we iterated through the entire path without exiting the loop,
then we are good to go, record it. */
if (j == path->length ())
- bitmap_set_bit (tmp, e->dest->index);
+ {
+ bitmap_set_bit (tmp, e->dest->index);
+ i++;
+ }
else
{
e->aux = NULL;
delete_jump_thread_path (path);
}
}
+ else
+ {
+ i++;
+ }
}
/* If optimizing for size, only thread through block if we don't have