OSDN Git Service

* tree-cfg.c (tree_split_edge): Speed up by using find_edge.
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-ccp.c
index b97424f..31807fe 100644 (file)
@@ -629,9 +629,6 @@ ccp_finalize (void)
   /* Perform substitutions based on the known constant values.  */
   substitute_and_fold ();
 
-  /* Now cleanup any unreachable code.  */
-  cleanup_tree_cfg ();
-
   free (value_vector);
 }
 
@@ -850,9 +847,7 @@ ccp_fold (tree stmt)
            op0 = get_value (op0)->const_val;
        }
 
-      retval = nondestructive_fold_unary_to_constant (code,
-                                                     TREE_TYPE (rhs),
-                                                     op0);
+      retval = fold_unary_to_constant (code, TREE_TYPE (rhs), op0);
 
       /* If we folded, but did not create an invariant, then we can not
         use this expression.  */
@@ -903,9 +898,7 @@ ccp_fold (tree stmt)
            op1 = val->const_val;
        }
 
-      retval = nondestructive_fold_binary_to_constant (code,
-                                                      TREE_TYPE (rhs),
-                                                      op0, op1);
+      retval = fold_binary_to_constant (code, TREE_TYPE (rhs), op0, op1);
 
       /* If we folded, but did not create an invariant, then we can not
         use this expression.  */
@@ -1123,7 +1116,7 @@ visit_cond_stmt (tree stmt, edge *taken_edge_p)
      to the worklist.  If no single edge can be determined statically,
      return SSA_PROP_VARYING to feed all the outgoing edges to the
      propagation engine.  */
-  *taken_edge_p = find_taken_edge (block, val.const_val);
+  *taken_edge_p = val.const_val ? find_taken_edge (block, val.const_val) : 0;
   if (*taken_edge_p)
     return SSA_PROP_INTERESTING;
   else
@@ -1229,7 +1222,7 @@ struct tree_opt_pass pass_ccp =
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  TODO_dump_func | TODO_rename_vars
+  TODO_cleanup_cfg | TODO_dump_func | TODO_rename_vars
     | TODO_ggc_collect | TODO_verify_ssa
     | TODO_verify_stmts,               /* todo_flags_finish */
   0                                    /* letter */