+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>
* c-common.c (builtin_define_std): Correct logic.
sbitmap *dom;
int *dfs_order;
int *rc_order;
- basic_block header;
+ basic_block header, bb;
/* This function cannot be repeatedly called with different
flags to build up the loop information. The loop tree
These are often the same as the loop header and
loop latch respectively, but this is not always
the case. */
- loop->first
- = BASIC_BLOCK (sbitmap_first_set_bit (loop->nodes));
- loop->last
- = BASIC_BLOCK (sbitmap_last_set_bit (loop->nodes));
+
+ FOR_EACH_BB (bb)
+ if (TEST_BIT (loop->nodes, bb->index))
+ 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);
}