X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fcfgloop.c;h=0365f568b301f98d1e2512eecd5cff62e34118f6;hb=c39d80f24328992f98049bc3eca8188951ba7762;hp=0e95323008a3ee1420c432d60d5f90797a839ead;hpb=e1ab78748da58d43da7f08cc64b9de80577f470e;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c index 0e95323008a..0365f568b30 100644 --- a/gcc/cfgloop.c +++ b/gcc/cfgloop.c @@ -1,5 +1,5 @@ /* Natural loop discovery code for GNU compiler. - Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007 + Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GCC. @@ -338,6 +338,8 @@ alloc_loop (void) loop->exits = GGC_CNEW (struct loop_exit); loop->exits->next = loop->exits->prev = loop->exits; + loop->can_be_parallel = false; + loop->single_iv = NULL_TREE; return loop; } @@ -521,7 +523,7 @@ flow_loops_find (struct loops *loops) profile is usually too flat and unreliable for this (and it is mostly based on the loop structure of the program, so it does not make much sense to derive the loop structure from it). */ - + static edge find_subloop_latch_edge_by_profile (VEC (edge, heap) *latches) { @@ -654,7 +656,7 @@ form_subloop (struct loop *loop, edge latch) edge_iterator ei; edge e, new_entry; struct loop *new_loop; - + mfb_reis_set = pointer_set_create (); FOR_EACH_EDGE (e, ei, loop->header->preds) { @@ -890,7 +892,7 @@ get_loop_body_in_dom_order (const struct loop *loop) /* Gets body of a LOOP sorted via provided BB_COMPARATOR. */ basic_block * -get_loop_body_in_custom_order (const struct loop *loop, +get_loop_body_in_custom_order (const struct loop *loop, int (*bb_comparator) (const void *, const void *)) { basic_block *bbs = get_loop_body (loop); @@ -981,7 +983,7 @@ loop_exit_free (void *ex) for (; exit; exit = next) { next = exit->next_e; - + exit->next->prev = exit->prev; exit->prev->next = exit->next; @@ -1035,7 +1037,7 @@ rescan_loop_exit (edge e, bool new_edge, bool removed) exit->next_e = exits; exits = exit; } - } + } if (!exits && new_edge) return; @@ -1521,7 +1523,7 @@ verify_loop_structure (void) exit = get_exit_descriptions (e); if (!exit) { - error ("Exit %d->%d not recorded", + error ("Exit %d->%d not recorded", e->src->index, e->dest->index); err = 1; } @@ -1539,7 +1541,7 @@ verify_loop_structure (void) if (eloops != 0) { - error ("Wrong list of exited loops for edge %d->%d", + error ("Wrong list of exited loops for edge %d->%d", e->src->index, e->dest->index); err = 1; } @@ -1620,3 +1622,18 @@ single_exit (const struct loop *loop) else return NULL; } + +/* Returns true when BB has an edge exiting LOOP. */ + +bool +is_loop_exit (struct loop *loop, basic_block bb) +{ + edge e; + edge_iterator ei; + + FOR_EACH_EDGE (e, ei, bb->preds) + if (loop_exit_edge_p (loop, e)) + return true; + + return false; +}