summaryrefslogtreecommitdiff
path: root/gcc/cfgloop.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-04 01:09:12 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-04 01:09:12 +0000
commitf24ec26f1cabb4f55cdb4370f35b67807df8fb7a (patch)
tree798273ffece1ba2938c3938e1c16af800a086eee /gcc/cfgloop.c
parente45bbad21b8f3590c89cc7193eaac430b547328f (diff)
downloadgcc-f24ec26f1cabb4f55cdb4370f35b67807df8fb7a.tar.gz
* tree-ssa-threadupdate.c (thread_through_all_blocks): Use loops' state
accessor functions. * cfgloopmanip.c (remove_path, create_preheaders, force_single_succ_latches, fix_loop_structure): Ditto. * tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa, tree_duplicate_loop_to_header_edge): Ditto. * cfgloopanal.c (mark_irreducible_loops): Ditto. * loop-init.c (loop_optimizer_init, loop_optimizer_finalize): Ditto. * tree-cfgcleanup.c (cleanup_tree_cfg_noloop, repair_loop_structures, cleanup_tree_cfg): Ditto. * tree-cfg.c (tree_merge_blocks): Ditto. * cfgloop.c (rescan_loop_exit, record_loop_exits, release_recorded_exits, get_loop_exit_edges, verify_loop_structure, loop_preheader_edge, single_exit): Ditto. (flow_loops_find): Do not clear loops->state. * cfgloop.h (loops_state_satisfies_p, loops_state_set, loops_state_clear): New functions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127197 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgloop.c')
-rw-r--r--gcc/cfgloop.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 411eb8eef46..fd26d5dc05d 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -502,7 +502,6 @@ flow_loops_find (struct loops *loops)
sbitmap_free (headers);
loops->exits = NULL;
- loops->state = 0;
return VEC_length (loop_p, loops->larray);
}
@@ -996,7 +995,7 @@ rescan_loop_exit (edge e, bool new_edge, bool removed)
struct loop_exit *exits = NULL, *exit;
struct loop *aloop, *cloop;
- if ((current_loops->state & LOOPS_HAVE_RECORDED_EXITS) == 0)
+ if (!loops_state_satisfies_p (LOOPS_HAVE_RECORDED_EXITS))
return;
if (!removed
@@ -1054,9 +1053,9 @@ record_loop_exits (void)
if (!current_loops)
return;
- if (current_loops->state & LOOPS_HAVE_RECORDED_EXITS)
+ if (loops_state_satisfies_p (LOOPS_HAVE_RECORDED_EXITS))
return;
- current_loops->state |= LOOPS_HAVE_RECORDED_EXITS;
+ loops_state_set (LOOPS_HAVE_RECORDED_EXITS);
gcc_assert (current_loops->exits == NULL);
current_loops->exits = htab_create_alloc (2 * number_of_loops (),
@@ -1109,10 +1108,10 @@ dump_recorded_exits (FILE *file)
void
release_recorded_exits (void)
{
- gcc_assert (current_loops->state & LOOPS_HAVE_RECORDED_EXITS);
+ gcc_assert (loops_state_satisfies_p (LOOPS_HAVE_RECORDED_EXITS));
htab_delete (current_loops->exits);
current_loops->exits = NULL;
- current_loops->state &= ~LOOPS_HAVE_RECORDED_EXITS;
+ loops_state_clear (LOOPS_HAVE_RECORDED_EXITS);
}
/* Returns the list of the exit edges of a LOOP. */
@@ -1131,7 +1130,7 @@ get_loop_exit_edges (const struct loop *loop)
/* If we maintain the lists of exits, use them. Otherwise we must
scan the body of the loop. */
- if (current_loops->state & LOOPS_HAVE_RECORDED_EXITS)
+ if (loops_state_satisfies_p (LOOPS_HAVE_RECORDED_EXITS))
{
for (exit = loop->exits->next; exit->e; exit = exit->next)
VEC_safe_push (edge, heap, edges, exit->e);
@@ -1352,13 +1351,13 @@ verify_loop_structure (void)
{
i = loop->num;
- if ((current_loops->state & LOOPS_HAVE_PREHEADERS)
+ if (loops_state_satisfies_p (LOOPS_HAVE_PREHEADERS)
&& EDGE_COUNT (loop->header->preds) != 2)
{
error ("loop %d's header does not have exactly 2 entries", i);
err = 1;
}
- if (current_loops->state & LOOPS_HAVE_SIMPLE_LATCHES)
+ if (loops_state_satisfies_p (LOOPS_HAVE_SIMPLE_LATCHES))
{
if (!single_succ_p (loop->latch))
{
@@ -1381,7 +1380,7 @@ verify_loop_structure (void)
error ("loop %d's header does not belong directly to it", i);
err = 1;
}
- if ((current_loops->state & LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS)
+ if (loops_state_satisfies_p (LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS)
&& (loop_latch_edge (loop)->flags & EDGE_IRREDUCIBLE_LOOP))
{
error ("loop %d's latch is marked as part of irreducible region", i);
@@ -1390,7 +1389,7 @@ verify_loop_structure (void)
}
/* Check irreducible loops. */
- if (current_loops->state & LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS)
+ if (loops_state_satisfies_p (LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS))
{
/* Record old info. */
irreds = sbitmap_alloc (last_basic_block);
@@ -1476,7 +1475,7 @@ verify_loop_structure (void)
}
}
- if ((current_loops->state & LOOPS_HAVE_RECORDED_EXITS) == 0)
+ if (!loops_state_satisfies_p (LOOPS_HAVE_RECORDED_EXITS))
{
if (loop->exits->next != loop->exits)
{
@@ -1487,7 +1486,7 @@ verify_loop_structure (void)
}
}
- if (current_loops->state & LOOPS_HAVE_RECORDED_EXITS)
+ if (loops_state_satisfies_p (LOOPS_HAVE_RECORDED_EXITS))
{
unsigned n_exits = 0, eloops;
@@ -1570,7 +1569,7 @@ loop_preheader_edge (const struct loop *loop)
edge e;
edge_iterator ei;
- gcc_assert ((current_loops->state & LOOPS_HAVE_PREHEADERS) != 0);
+ gcc_assert (loops_state_satisfies_p (LOOPS_HAVE_PREHEADERS));
FOR_EACH_EDGE (e, ei, loop->header->preds)
if (e->src != loop->latch)
@@ -1597,7 +1596,7 @@ single_exit (const struct loop *loop)
{
struct loop_exit *exit = loop->exits->next;
- if ((current_loops->state & LOOPS_HAVE_RECORDED_EXITS) == 0)
+ if (!loops_state_satisfies_p (LOOPS_HAVE_RECORDED_EXITS))
return NULL;
if (exit->e && exit->next == loop->exits)