lambda-code (perfect_nestify): Remove mark/unmark for rewriting hack.
authorDaniel Berlin <dberlin@dberlin.org>
Thu, 17 Feb 2005 16:29:56 +0000 (16:29 +0000)
committerDaniel Berlin <dberlin@gcc.gnu.org>
Thu, 17 Feb 2005 16:29:56 +0000 (16:29 +0000)
2005-02-17  Daniel Berlin  <dberlin@dberlin.org>

* lambda-code (perfect_nestify): Remove mark/unmark
for rewriting hack.
* tree-loop-linear.c (linear_transform_loops): Add
rewrite_into_ssa call so that ssa is correct for
rewriting into loop closed.

From-SVN: r95173

gcc/ChangeLog
gcc/lambda-code.c
gcc/tree-loop-linear.c

index a5511cc0e4ad9b3588fc0d6d0a07953601f14d19..c4eab1a3b6c240453ef276ef6deb3ca548639a55 100644 (file)
@@ -1,3 +1,11 @@
+2005-02-17  Daniel Berlin  <dberlin@dberlin.org>
+
+       * lambda-code (perfect_nestify): Remove mark/unmark
+       for rewriting hack.
+       * tree-loop-linear.c (linear_transform_loops): Add
+       rewrite_into_ssa call so that ssa is correct for
+       rewriting into loop closed.
+
 2005-02-17  Nathan Sidwell  <nathan@codesourcery.com>
 
        * bitmap.h (BITMAP_XMALLOC, BITMAP_XFREE): Remove.
index 01310cca0b92433c6eea800c38526bdc9db74797..037be930a43e73a05997a64292ad4586a1863e4d 100644 (file)
@@ -2314,23 +2314,23 @@ perfect_nestify (struct loops *loops,
   preheaderbb =  loop_split_edge_with (loop->single_exit, NULL);
   headerbb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
   
-  /* This is done because otherwise, it will release the ssa_name too early
-     when the edge gets redirected and it will get reused, causing the use of
-     the phi node to get rewritten.  */
-
+  /* Push the exit phi nodes that we are moving.  */
   for (phi = phi_nodes (olddest); phi; phi = PHI_CHAIN (phi))
     {
       VEC_safe_push (tree, phis, PHI_RESULT (phi));
       VEC_safe_push (tree, phis, PHI_ARG_DEF (phi, 0));
-      mark_for_rewrite (PHI_RESULT (phi));
     }
   e = redirect_edge_and_branch (EDGE_SUCC (preheaderbb, 0), headerbb);
 
-  /* Remove the exit phis from the old basic block.  */
+  /* Remove the exit phis from the old basic block.  Make sure to set
+     PHI_RESULT to null so it doesn't get released.  */
   while (phi_nodes (olddest) != NULL)
-    remove_phi_node (phi_nodes (olddest), NULL, olddest);
+    {
+      SET_PHI_RESULT (phi_nodes (olddest), NULL);
+      remove_phi_node (phi_nodes (olddest), NULL, olddest);
+    }      
 
-  /* and add them to the new basic block.  */
+  /* and add them back to the new basic block.  */
   while (VEC_length (tree, phis) != 0)
     {
       tree def;
@@ -2341,7 +2341,6 @@ perfect_nestify (struct loops *loops,
       add_phi_arg (phi, def, EDGE_PRED (preheaderbb, 0));
     }       
   flush_pending_stmts (e);
-  unmark_all_for_rewrite ();
 
   bodybb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
   latchbb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
index 6c8bafe89c3aded000727119559ff9285b421a0f..b8c6201ff88141a4f613ec589f1264204db3eb81 100644 (file)
@@ -374,6 +374,7 @@ linear_transform_loops (struct loops *loops)
     }
   free_df ();
   scev_reset ();
+  rewrite_into_ssa (false);
   rewrite_into_loop_closed_ssa ();
 #ifdef ENABLE_CHECKING
   verify_loop_closed_ssa ();