Commit 8a72fb76 by Zdenek Dvorak Committed by Zdenek Dvorak

cfgloop.c (flow_loops_find): Initialize first and last fields correctly.

	* cfgloop.c (flow_loops_find): Initialize first and last fields
	correctly.

From-SVN: r54104
parent ba9e1571
2002-05-31 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* cfgloop.c (flow_loops_find): Initialize first and last fields
correctly.
2002-05-31 Neil Booth <neil@daikokuya.demon.co.uk> 2002-05-31 Neil Booth <neil@daikokuya.demon.co.uk>
* c-common.c (builtin_define_std): Correct logic. * c-common.c (builtin_define_std): Correct logic.
......
...@@ -644,7 +644,7 @@ flow_loops_find (loops, flags) ...@@ -644,7 +644,7 @@ flow_loops_find (loops, flags)
sbitmap *dom; sbitmap *dom;
int *dfs_order; int *dfs_order;
int *rc_order; int *rc_order;
basic_block header; basic_block header, bb;
/* This function cannot be repeatedly called with different /* This function cannot be repeatedly called with different
flags to build up the loop information. The loop tree flags to build up the loop information. The loop tree
...@@ -768,10 +768,16 @@ flow_loops_find (loops, flags) ...@@ -768,10 +768,16 @@ flow_loops_find (loops, flags)
These are often the same as the loop header and These are often the same as the loop header and
loop latch respectively, but this is not always loop latch respectively, but this is not always
the case. */ the case. */
loop->first
= BASIC_BLOCK (sbitmap_first_set_bit (loop->nodes)); FOR_EACH_BB (bb)
loop->last if (TEST_BIT (loop->nodes, bb->index))
= BASIC_BLOCK (sbitmap_last_set_bit (loop->nodes)); break;
loop->first = bb;
FOR_EACH_BB_REVERSE (bb)
if (TEST_BIT (loop->nodes, bb->index))
break;
loop->last = bb;
flow_loop_scan (loops, loop, flags); flow_loop_scan (loops, loop, flags);
} }
......
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