diff mbox

Minor fix to marking visited notes in jump threading

Message ID 528F095E.80601@redhat.com
State New
Headers show

Commit Message

Jeff Law Nov. 22, 2013, 7:35 a.m. UTC
Just something I noticed while looking at a problem tonight.  We 
threaded all the way back to the start of a jump threading path because 
we didn't mark both blocks on the starting edge.

Bootstrapped and regression tested on x86_64-unknown-linux-gnu. 
Installed on the trunk.

Jeff
* tree-ssa-threadedge.c (thread_across_edge): Mark the start of the
	jump thread path properly.
diff mbox

Patch

diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index a144875..7600d7b 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -1078,8 +1078,9 @@  thread_across_edge (gimple dummy_cond,
      
 	/* Avoid threading to any block we have already visited.  */
 	bitmap_clear (visited);
-	bitmap_set_bit (visited, taken_edge->dest->index);
+	bitmap_set_bit (visited, e->src->index);
 	bitmap_set_bit (visited, e->dest->index);
+	bitmap_set_bit (visited, taken_edge->dest->index);
         vec<jump_thread_edge *> *path = new vec<jump_thread_edge *> ();
 
 	/* Record whether or not we were able to thread through a successor