summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/tree-cfg.c6
-rw-r--r--gcc/tree-flow.h1
-rw-r--r--gcc/tree-ssa-loop-niter.c6
4 files changed, 19 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ff5e2022c72..31163ac68ac 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2005-10-09 Zdenek Dvorak <dvorakz@suse.cz>
+
+ PR tree-optimization/24226
+ * tree-cfg.c (remove_bb): Clean up unreachable loops.
+ * tree-flow.h (free_numbers_of_iterations_estimates_loop): Declare.
+ * tree-ssa-loop-niter.c (free_numbers_of_iterations_estimates_loop):
+ Export.
+
2005-10-09 Eric Botcazou <ebotcazou@libertysurf.fr>
* config/sparc/gmon-sol2.c (internal_mcount): Mark as used.
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 74e6063c0ab..2a0d75a2970 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -2020,6 +2020,12 @@ remove_bb (basic_block bb)
{
loop->latch = NULL;
loop->header = NULL;
+
+ /* Also clean up the information associated with the loop. Updating
+ it would waste time. More importantly, it may refer to ssa
+ names that were defined in other removed basic block -- these
+ ssa names are now removed and invalid. */
+ free_numbers_of_iterations_estimates_loop (loop);
}
}
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index f00f09ebba9..135c475f62b 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -735,6 +735,7 @@ bool scev_probably_wraps_p (tree, tree, tree, tree, struct loop *, bool *,
bool *);
tree convert_step (struct loop *, tree, tree, tree, tree);
void free_numbers_of_iterations_estimates (struct loops *);
+void free_numbers_of_iterations_estimates_loop (struct loop *);
void rewrite_into_loop_closed_ssa (bitmap, unsigned);
void verify_loop_closed_ssa (void);
void loop_commit_inserts (void);
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 6d8b5086de5..5e35f4efb83 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -2007,11 +2007,13 @@ convert_step (struct loop *loop, tree new_type, tree base, tree step,
/* Frees the information on upper bounds on numbers of iterations of LOOP. */
-static void
+void
free_numbers_of_iterations_estimates_loop (struct loop *loop)
{
struct nb_iter_bound *bound, *next;
-
+
+ loop->nb_iterations = NULL;
+ loop->estimated_nb_iterations = NULL;
for (bound = loop->bounds; bound; bound = next)
{
next = bound->next;