Commit 6d4fbcc9 by Jeff Law Committed by Jeff Law

re PR rtl-optimization/59446 (loop2_doloop creates constant comparison and dead jump)

	PR rtl-optimization/59446
	* tree-ssa-threadupdate.c (mark_threaded_blocks): Properly
	test for crossing a loop header.

From-SVN: r205905
parent 26084432
2013-12-11 Jeff Law <law@redhat.com>
PR rtl-optimization/59446
* tree-ssa-threadupdate.c (mark_threaded_blocks): Properly
test for crossing a loop header.
2013-12-11 Sriraman Tallam <tmsriram@google.com> 2013-12-11 Sriraman Tallam <tmsriram@google.com>
PR target/59390 PR target/59390
...@@ -1449,20 +1449,13 @@ mark_threaded_blocks (bitmap threaded_blocks) ...@@ -1449,20 +1449,13 @@ mark_threaded_blocks (bitmap threaded_blocks)
{ {
vec<jump_thread_edge *> *path = THREAD_PATH (e); vec<jump_thread_edge *> *path = THREAD_PATH (e);
/* Basically we're looking for a situation where we can see for (unsigned int i = 0, crossed_headers = 0;
3 or more loop structures on a jump threading path. */ i < path->length ();
i++)
struct loop *first_father = (*path)[0]->e->src->loop_father;
struct loop *second_father = NULL;
for (unsigned int i = 0; i < path->length (); i++)
{ {
/* See if this is a loop father we have not seen before. */ basic_block dest = (*path)[i]->e->dest;
if ((*path)[i]->e->dest->loop_father != first_father crossed_headers += (dest == dest->loop_father->header);
&& (*path)[i]->e->dest->loop_father != second_father) if (crossed_headers > 1)
{
/* We've already seen two loop fathers, so we
need to trim this jump threading path. */
if (second_father != NULL)
{ {
/* Trim from entry I onwards. */ /* Trim from entry I onwards. */
for (unsigned int j = i; j < path->length (); j++) for (unsigned int j = i; j < path->length (); j++)
...@@ -1483,11 +1476,6 @@ mark_threaded_blocks (bitmap threaded_blocks) ...@@ -1483,11 +1476,6 @@ mark_threaded_blocks (bitmap threaded_blocks)
} }
break; break;
} }
else
{
second_father = (*path)[i]->e->dest->loop_father;
}
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment