re PR tree-optimization/26209 (Specific code causes g++ 4.1.0 dominance ICE when...
authorZdenek Dvorak <rakdver@gcc.gnu.org>
Tue, 14 Feb 2006 23:55:22 +0000 (23:55 +0000)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Tue, 14 Feb 2006 23:55:22 +0000 (23:55 +0000)
PR tree-optimization/26209
* tree-ssa-loop.c (pass_scev_cprop): Add TODO_cleanup_cfg.
* tree-cfgcleanup.c (cleanup_control_flow): Remove dead
eh edges.
* tree-cfg.c (replace_uses_by): Do not alter cfg.

From-SVN: r110999

gcc/ChangeLog
gcc/tree-cfg.c
gcc/tree-cfgcleanup.c
gcc/tree-ssa-loop.c

index a134098cc8187fdd747e3c4a61c4d29ab433791a..6312500c0ec3830709a8e99a3c290808e1d10270 100644 (file)
@@ -1,3 +1,11 @@
+2006-02-14  Zdenek Dvorak <dvorakz@suse.cz>
+
+       PR tree-optimization/26209
+       * tree-ssa-loop.c (pass_scev_cprop): Add TODO_cleanup_cfg.
+       * tree-cfgcleanup.c (cleanup_control_flow): Remove dead
+       eh edges.
+       * tree-cfg.c (replace_uses_by): Do not alter cfg.
+
 2006-02-14  Roger Sayle  <roger@eyesopen.com>
 
        PR middle-end/23670
@@ -8,7 +16,7 @@
 
 2006-02-14  Roger Sayle  <roger@eyesopen.com>
 
-        * dojump.c (do_compare_rtx_and_jump): Also handle multi-word GTU
+       * dojump.c (do_compare_rtx_and_jump): Also handle multi-word GTU
        and GEU.
 
 2006-02-14  Adam Nemet  <anemet@caviumnetworks.com>
index 0724c1021636a4bc6a90220b7500a87cf93f3300..60dacbd5fc8f9e0ff55acb3f6ff3c9ba4e8afd54 100644 (file)
@@ -1347,10 +1347,7 @@ replace_uses_by (tree name, tree val)
       if (TREE_CODE (rhs) == ADDR_EXPR)
        recompute_tree_invariant_for_addr_expr (rhs);
 
-      /* If the statement could throw and now cannot, we need to prune cfg.  */
-      if (maybe_clean_or_replace_eh_stmt (stmt, stmt))
-       tree_purge_dead_eh_edges (bb_for_stmt (stmt));
-
+      maybe_clean_or_replace_eh_stmt (stmt, stmt);
       mark_new_vars_to_rename (stmt);
     }
 
index 76667a6edc17d6301898de34c772a0602093eb26..dc0380aefc207dd53a9a22f27b9db582e474dfa9 100644 (file)
@@ -158,19 +158,24 @@ cleanup_control_flow (void)
     {
       bsi = bsi_last (bb);
 
+      /* If the last statement of the block could throw and now cannot,
+        we need to prune cfg.  */
+      tree_purge_dead_eh_edges (bb);
+
       if (bsi_end_p (bsi))
        continue;
 
       stmt = bsi_stmt (bsi);
+
       if (TREE_CODE (stmt) == COND_EXPR
          || TREE_CODE (stmt) == SWITCH_EXPR)
        retval |= cleanup_control_expr_graph (bb, bsi);
-
       /* If we had a computed goto which has a compile-time determinable
         destination, then we can eliminate the goto.  */
-      if (TREE_CODE (stmt) == GOTO_EXPR
-         && TREE_CODE (GOTO_DESTINATION (stmt)) == ADDR_EXPR
-         && TREE_CODE (TREE_OPERAND (GOTO_DESTINATION (stmt), 0)) == LABEL_DECL)
+      else if (TREE_CODE (stmt) == GOTO_EXPR
+              && TREE_CODE (GOTO_DESTINATION (stmt)) == ADDR_EXPR
+              && (TREE_CODE (TREE_OPERAND (GOTO_DESTINATION (stmt), 0))
+                  == LABEL_DECL))
        {
          edge e;
          tree label;
@@ -214,7 +219,7 @@ cleanup_control_flow (void)
 
       /* Check for indirect calls that have been turned into
         noreturn calls.  */
-      if (noreturn_call_p (stmt) && remove_fallthru_edge (bb->succs))
+      else if (noreturn_call_p (stmt) && remove_fallthru_edge (bb->succs))
        {
          free_dominance_info (CDI_DOMINATORS);
          retval = true;
index 60cdefcbe242bdcaab2b5fd1abfb0979a835bd17..e128c36808425b8d9e04acc57fe58682f9095132 100644 (file)
@@ -302,7 +302,8 @@ struct tree_opt_pass pass_scev_cprop =
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  TODO_dump_func | TODO_update_ssa_only_virtuals,
+  TODO_dump_func | TODO_cleanup_cfg
+    | TODO_update_ssa_only_virtuals,
                                        /* todo_flags_finish */
   0                                    /* letter */
 };