X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Ftree-ssa-phiopt.c;h=30eea319edcc21e2d7bb2179eb135ace89701043;hb=c7447c8278c8ef10ab99630497871370df3bdd4c;hp=77ce5b02f7baf75c195594959e51ce7e8035edb6;hpb=ec611e12ce8e4197423df6d41eb40a891442ac29;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c index 77ce5b02f7b..30eea319edc 100644 --- a/gcc/tree-ssa-phiopt.c +++ b/gcc/tree-ssa-phiopt.c @@ -544,8 +544,9 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb, /* To handle special cases like floating point comparison, it is easier and less error-prone to build a tree and gimplify it on the fly though it is less efficient. */ - cond = fold_build2 (gimple_cond_code (stmt), boolean_type_node, - gimple_cond_lhs (stmt), gimple_cond_rhs (stmt)); + cond = fold_build2_loc (gimple_location (stmt), + gimple_cond_code (stmt), boolean_type_node, + gimple_cond_lhs (stmt), gimple_cond_rhs (stmt)); /* We need to know which is the true edge and which is the false edge so that we know when to invert the condition below. */ @@ -554,7 +555,8 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb, || (e0 == false_edge && integer_onep (arg0)) || (e1 == true_edge && integer_zerop (arg1)) || (e1 == false_edge && integer_onep (arg1))) - cond = fold_build1 (TRUTH_NOT_EXPR, TREE_TYPE (cond), cond); + cond = fold_build1_loc (gimple_location (stmt), + TRUTH_NOT_EXPR, TREE_TYPE (cond), cond); /* Insert our new statements at the end of conditional block before the COND_STMT. */ @@ -695,7 +697,6 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb, cond = last_stmt (cond_bb); cmp = gimple_cond_code (cond); - result = PHI_RESULT (phi); /* This transformation is only valid for order comparisons. Record which operand is smaller/larger if the result of the comparison is true. */ @@ -1453,7 +1454,7 @@ cond_if_else_store_replacement (basic_block then_bb, basic_block else_bb, continue; then_store = DR_STMT (then_dr); - then_lhs = gimple_assign_lhs (then_store); + then_lhs = gimple_get_lhs (then_store); found = false; FOR_EACH_VEC_ELT (data_reference_p, else_datarefs, j, else_dr) @@ -1462,7 +1463,7 @@ cond_if_else_store_replacement (basic_block then_bb, basic_block else_bb, continue; else_store = DR_STMT (else_dr); - else_lhs = gimple_assign_lhs (else_store); + else_lhs = gimple_get_lhs (else_store); if (operand_equal_p (then_lhs, else_lhs, 0)) { @@ -1494,8 +1495,6 @@ cond_if_else_store_replacement (basic_block then_bb, basic_block else_bb, else_ddrs = VEC_alloc (ddr_p, heap, 1); compute_all_dependences (then_datarefs, &then_ddrs, NULL, false); compute_all_dependences (else_datarefs, &else_ddrs, NULL, false); - free_data_refs (then_datarefs); - free_data_refs (else_datarefs); blocks[0] = then_bb; blocks[1] = else_bb; blocks[2] = join_bb; @@ -1517,6 +1516,8 @@ cond_if_else_store_replacement (basic_block then_bb, basic_block else_bb, { free_dependence_relations (then_ddrs); free_dependence_relations (else_ddrs); + free_data_refs (then_datarefs); + free_data_refs (else_datarefs); VEC_free (gimple, heap, then_stores); VEC_free (gimple, heap, else_stores); return false; @@ -1539,6 +1540,8 @@ cond_if_else_store_replacement (basic_block then_bb, basic_block else_bb, { free_dependence_relations (then_ddrs); free_dependence_relations (else_ddrs); + free_data_refs (then_datarefs); + free_data_refs (else_datarefs); VEC_free (gimple, heap, then_stores); VEC_free (gimple, heap, else_stores); return false; @@ -1556,6 +1559,8 @@ cond_if_else_store_replacement (basic_block then_bb, basic_block else_bb, free_dependence_relations (then_ddrs); free_dependence_relations (else_ddrs); + free_data_refs (then_datarefs); + free_data_refs (else_datarefs); VEC_free (gimple, heap, then_stores); VEC_free (gimple, heap, else_stores); @@ -1585,8 +1590,7 @@ struct gimple_opt_pass pass_phiopt = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func - | TODO_ggc_collect + TODO_ggc_collect | TODO_verify_ssa | TODO_verify_flow | TODO_verify_stmts /* todo_flags_finish */ @@ -1614,8 +1618,7 @@ struct gimple_opt_pass pass_cselim = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func - | TODO_ggc_collect + TODO_ggc_collect | TODO_verify_ssa | TODO_verify_flow | TODO_verify_stmts /* todo_flags_finish */