PR tree-optimization/24226
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Oct 2005 22:50:01 +0000 (22:50 +0000)
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Oct 2005 22:50:01 +0000 (22:50 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105151 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-cfg.c
gcc/tree-flow.h
gcc/tree-ssa-loop-niter.c

index ff5e202..31163ac 100644 (file)
@@ -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.
index 74e6063..2a0d75a 100644 (file)
@@ -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);
        }
     }
 
index f00f09e..135c475 100644 (file)
@@ -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);
index 6d8b508..5e35f4e 100644 (file)
@@ -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;