From a310245f28284af5e0f969dbc86ef4cb42fe83f0 Mon Sep 17 00:00:00 2001 From: Steven Bosscher Date: Sun, 20 Feb 2005 11:09:16 +0000 Subject: 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 --- gcc/cfgloop.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gcc/cfgloop.c') 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 * -- cgit v1.1