diff options
author | Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> | 2002-05-31 13:09:17 +0200 |
---|---|---|
committer | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2002-05-31 11:09:17 +0000 |
commit | 8a72fb761ecbcb9ec734eea3ce550caa08a3d014 (patch) | |
tree | d4430a77bc104b74e1942c1593f798f1f7300879 /gcc | |
parent | ba9e1571a0e065e80e0dc0a2b43e13c45b12cf25 (diff) | |
download | gcc-8a72fb761ecbcb9ec734eea3ce550caa08a3d014.zip gcc-8a72fb761ecbcb9ec734eea3ce550caa08a3d014.tar.gz gcc-8a72fb761ecbcb9ec734eea3ce550caa08a3d014.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cfgloop.c | 16 |
2 files changed, 16 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 151362c..b202758 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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. diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c index aed2641..7b0c841 100644 --- a/gcc/cfgloop.c +++ b/gcc/cfgloop.c @@ -644,7 +644,7 @@ flow_loops_find (loops, flags) 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 @@ -768,10 +768,16 @@ flow_loops_find (loops, flags) 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); } |