Mercurial > hg > CbC > CbC_gcc
diff gcc/tree-ssa-uncprop.c @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | a06113de4d67 |
children | b7f97abdc517 |
line wrap: on
line diff
--- a/gcc/tree-ssa-uncprop.c Sun Feb 07 18:28:00 2010 +0900 +++ b/gcc/tree-ssa-uncprop.c Fri Feb 12 23:39:51 2010 +0900 @@ -53,7 +53,7 @@ in the CFG. When complete, each edge that creates an equivalency will have an - EDGE_EQUIVALENCY structure hanging off the edge's AUX field. + EDGE_EQUIVALENCY structure hanging off the edge's AUX field. The caller is responsible for freeing the AUX fields. */ static void @@ -157,7 +157,7 @@ equivalency->rhs = op1; if (code == EQ_EXPR) true_edge->aux = equivalency; - else + else false_edge->aux = equivalency; } @@ -177,7 +177,7 @@ && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (cond)) { int i, n_labels = gimple_switch_num_labels (stmt); - tree *info = XCNEWVEC (tree, n_basic_blocks); + tree *info = XCNEWVEC (tree, last_basic_block); /* Walk over the case label vector. Record blocks which are reached by a single case label which represents @@ -289,9 +289,9 @@ VEC(tree,heap) *equivalences; }; -static void uncprop_initialize_block (struct dom_walk_data *, basic_block); -static void uncprop_finalize_block (struct dom_walk_data *, basic_block); -static void uncprop_into_successor_phis (struct dom_walk_data *, basic_block); +static void uncprop_enter_block (struct dom_walk_data *, basic_block); +static void uncprop_leave_block (struct dom_walk_data *, basic_block); +static void uncprop_into_successor_phis (basic_block); /* Hashing and equality routines for the hash table. */ @@ -358,7 +358,7 @@ free (equiv_hash_elt); equiv_hash_elt = (struct equiv_hash_elt *) *slot; - + VEC_safe_push (tree, heap, equiv_hash_elt->equivalences, equivalence); } @@ -381,18 +381,12 @@ calculate_dominance_info (CDI_DOMINATORS); /* Setup callbacks for the generic dominator tree walker. */ - walk_data.walk_stmts_backward = false; walk_data.dom_direction = CDI_DOMINATORS; walk_data.initialize_block_local_data = NULL; - walk_data.before_dom_children_before_stmts = uncprop_initialize_block; - walk_data.before_dom_children_walk_stmts = NULL; - walk_data.before_dom_children_after_stmts = uncprop_into_successor_phis; - walk_data.after_dom_children_before_stmts = NULL; - walk_data.after_dom_children_walk_stmts = NULL; - walk_data.after_dom_children_after_stmts = uncprop_finalize_block; + walk_data.before_dom_children = uncprop_enter_block; + walk_data.after_dom_children = uncprop_leave_block; walk_data.global_data = NULL; walk_data.block_local_data_size = 0; - walk_data.interesting_blocks = NULL; /* Now initialize the dominator walker. */ init_walk_dominator_tree (&walk_data); @@ -432,8 +426,8 @@ the dominator tree. */ static void -uncprop_finalize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED, - basic_block bb ATTRIBUTE_UNUSED) +uncprop_leave_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED, + basic_block bb ATTRIBUTE_UNUSED) { /* Pop the topmost value off the equiv stack. */ tree value = VEC_pop (tree, equiv_stack); @@ -447,8 +441,7 @@ /* Unpropagate values from PHI nodes in successor blocks of BB. */ static void -uncprop_into_successor_phis (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED, - basic_block bb) +uncprop_into_successor_phis (basic_block bb) { edge e; edge_iterator ei; @@ -476,7 +469,6 @@ /* Walk over the PHI nodes, unpropagating values. */ for (gsi = gsi_start (phis) ; !gsi_end_p (gsi); gsi_next (&gsi)) { - /* Sigh. We'll have more efficient access to this one day. */ gimple phi = gsi_stmt (gsi); tree arg = PHI_ARG_DEF (phi, e->dest_idx); struct equiv_hash_elt equiv_hash_elt; @@ -556,8 +548,8 @@ } static void -uncprop_initialize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED, - basic_block bb) +uncprop_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED, + basic_block bb) { basic_block parent; edge e; @@ -583,6 +575,8 @@ if (!recorded) VEC_safe_push (tree, heap, equiv_stack, NULL_TREE); + + uncprop_into_successor_phis (bb); } static bool @@ -591,7 +585,7 @@ return flag_tree_dom != 0; } -struct gimple_opt_pass pass_uncprop = +struct gimple_opt_pass pass_uncprop = { { GIMPLE_PASS,