diff options
author | Steven Bosscher <steven@gcc.gnu.org> | 2005-02-20 11:09:16 +0000 |
---|---|---|
committer | Steven Bosscher <steven@gcc.gnu.org> | 2005-02-20 11:09:16 +0000 |
commit | a310245f28284af5e0f969dbc86ef4cb42fe83f0 (patch) | |
tree | 90c7593e6e12d11084f0ca47062016f232b3612f /gcc/cfgloop.c | |
parent | 9f9348d75afa0bbeb07232c7ad1acc4941b0d8fa (diff) | |
download | gcc-a310245f28284af5e0f969dbc86ef4cb42fe83f0.zip gcc-a310245f28284af5e0f969dbc86ef4cb42fe83f0.tar.gz gcc-a310245f28284af5e0f969dbc86ef4cb42fe83f0.tar.bz2 |
re PR middle-end/19698 (Infinite loop in update_life_info)
PR middle-end/19698
* function.h (struct function): New field `max_loop_depth'.
* cfgloop.c (establish_preds): Update maximum loop depth seen so far.
(flow_loops_find): Reset the max loop depth count before finding loops.
* flow.c (MAX_LIVENESS_ROUNDS): New constant.
(update_life_info_in_dirty_blocks): Remove 2002-05-28 workaround.
(calculate_global_regs_live): Make sure the loop will terminate
when the initial sets are not empty.
From-SVN: r95299
Diffstat (limited to 'gcc/cfgloop.c')
-rw-r--r-- | gcc/cfgloop.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c index 4fb687c..40a6de4 100644 --- a/gcc/cfgloop.c +++ b/gcc/cfgloop.c @@ -25,6 +25,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "rtl.h" #include "hard-reg-set.h" #include "obstack.h" +#include "function.h" #include "basic-block.h" #include "toplev.h" #include "cfgloop.h" @@ -510,6 +511,10 @@ establish_preds (struct loop *loop) struct loop *ploop, *father = loop->outer; loop->depth = father->depth + 1; + + /* Remember the current loop depth if it is the largest seen so far. */ + cfun->max_loop_depth = MAX (cfun->max_loop_depth, loop->depth); + if (loop->pred) free (loop->pred); loop->pred = xmalloc (sizeof (struct loop *) * loop->depth); @@ -819,6 +824,10 @@ flow_loops_find (struct loops *loops, int flags) memset (loops, 0, sizeof *loops); + /* We are going to recount the maximum loop depth, + so throw away the last count. */ + cfun->max_loop_depth = 0; + /* Taking care of this degenerate case makes the rest of this code simpler. */ if (n_basic_blocks == 0) @@ -1213,7 +1222,7 @@ remove_bb_from_loops (basic_block bb) loop->pred[i]->num_nodes--; bb->loop_father = NULL; bb->loop_depth = 0; - } +} /* Finds nearest common ancestor in loop tree for given loops. */ struct loop * |