diff options
Diffstat (limited to 'gcc/ipa-split.c')
-rw-r--r-- | gcc/ipa-split.c | 78 |
1 files changed, 2 insertions, 76 deletions
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c index b03ae029..23d1df9 100644 --- a/gcc/ipa-split.c +++ b/gcc/ipa-split.c @@ -104,7 +104,6 @@ along with GCC; see the file COPYING3. If not see #include "gimple-pretty-print.h" #include "ipa-fnsummary.h" #include "cfgloop.h" -#include "tree-chkp.h" /* Per basic block info. */ @@ -151,7 +150,6 @@ struct split_point best_split_point; static bitmap forbidden_dominators; static tree find_retval (basic_block return_bb); -static tree find_retbnd (basic_block return_bb); /* Callback for walk_stmt_load_store_addr_ops. If T is non-SSA automatic variable, check it if it is present in bitmap passed via DATA. */ @@ -433,7 +431,6 @@ consider_split (struct split_point *current, bitmap non_ssa_vars, gphi_iterator bsi; unsigned int i; tree retval; - tree retbnd; bool back_edge = false; if (dump_file && (dump_flags & TDF_DETAILS)) @@ -678,29 +675,6 @@ consider_split (struct split_point *current, bitmap non_ssa_vars, else current->split_part_set_retval = true; - /* See if retbnd used by return bb is computed by header or split part. */ - retbnd = find_retbnd (return_bb); - if (retbnd) - { - bool split_part_set_retbnd - = split_part_set_ssa_name_p (retbnd, current, return_bb); - - /* If we have both return value and bounds then keep their definitions - in a single function. We use SSA names to link returned bounds and - value and therefore do not handle cases when result is passed by - reference (which should not be our case anyway since bounds are - returned for pointers only). */ - if ((DECL_BY_REFERENCE (DECL_RESULT (current_function_decl)) - && current->split_part_set_retval) - || split_part_set_retbnd != current->split_part_set_retval) - { - if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, - " Refused: split point splits return value and bounds\n"); - return; - } - } - /* split_function fixes up at most one PHI non-virtual PHI node in return_bb, for the return value. If there are other PHIs, give up. */ if (return_bb != EXIT_BLOCK_PTR_FOR_FN (cfun)) @@ -830,18 +804,6 @@ find_retval (basic_block return_bb) return NULL; } -/* Given return basic block RETURN_BB, see where return bounds are really - stored. */ -static tree -find_retbnd (basic_block return_bb) -{ - gimple_stmt_iterator bsi; - for (bsi = gsi_last_bb (return_bb); !gsi_end_p (bsi); gsi_prev (&bsi)) - if (gimple_code (gsi_stmt (bsi)) == GIMPLE_RETURN) - return gimple_return_retbnd (gsi_stmt (bsi)); - return NULL; -} - /* Callback for walk_stmt_load_store_addr_ops. If T is non-SSA automatic variable, mark it as used in bitmap passed via DATA. Return true when access to T prevents splitting the function. */ @@ -1228,8 +1190,7 @@ split_function (basic_block return_bb, struct split_point *split_point, gcall *call, *tsan_func_exit_call = NULL; edge e; edge_iterator ei; - tree retval = NULL, real_retval = NULL, retbnd = NULL; - bool with_bounds = chkp_function_instrumented_p (current_function_decl); + tree retval = NULL, real_retval = NULL; gimple *last_stmt = NULL; unsigned int i; tree arg, ddef; @@ -1311,14 +1272,10 @@ split_function (basic_block return_bb, struct split_point *split_point, e = make_single_succ_edge (new_return_bb, EXIT_BLOCK_PTR_FOR_FN (cfun), 0); add_bb_to_loop (new_return_bb, current_loops->tree_root); bitmap_set_bit (split_point->split_bbs, new_return_bb->index); - retbnd = find_retbnd (return_bb); } /* When we pass around the value, use existing return block. */ else - { - bitmap_set_bit (split_point->split_bbs, return_bb->index); - retbnd = find_retbnd (return_bb); - } + bitmap_set_bit (split_point->split_bbs, return_bb->index); /* If RETURN_BB has virtual operand PHIs, they must be removed and the virtual operand marked for renaming as we change the CFG in a way that @@ -1434,11 +1391,6 @@ split_function (basic_block return_bb, struct split_point *split_point, } } - /* If the original function is instrumented then it's - part is also instrumented. */ - if (with_bounds) - chkp_function_mark_instrumented (node->decl); - /* If the original function is declared inline, there is no point in issuing a warning for the non-inlinable part. */ DECL_NO_INLINE_WARNING_P (node->decl) = 1; @@ -1474,7 +1426,6 @@ split_function (basic_block return_bb, struct split_point *split_point, args_to_pass[i] = arg; } call = gimple_build_call_vec (node->decl, args_to_pass); - gimple_call_set_with_bounds (call, with_bounds); gimple_set_block (call, DECL_INITIAL (current_function_decl)); args_to_pass.release (); @@ -1618,21 +1569,6 @@ split_function (basic_block return_bb, struct split_point *split_point, } } } - - /* Replace retbnd with new one. */ - if (retbnd) - { - gimple_stmt_iterator bsi; - for (bsi = gsi_last_bb (return_bb); !gsi_end_p (bsi); - gsi_prev (&bsi)) - if (gimple_code (gsi_stmt (bsi)) == GIMPLE_RETURN) - { - retbnd = copy_ssa_name (retbnd, call); - gimple_return_set_retbnd (gsi_stmt (bsi), retbnd); - update_stmt (gsi_stmt (bsi)); - break; - } - } } if (DECL_BY_REFERENCE (DECL_RESULT (current_function_decl))) { @@ -1653,9 +1589,6 @@ split_function (basic_block return_bb, struct split_point *split_point, gsi_insert_after (&gsi, cpy, GSI_NEW_STMT); retval = tem; } - /* Build bndret call to obtain returned bounds. */ - if (retbnd) - chkp_insert_retbnd_call (retbnd, retval, &gsi); gimple_call_set_lhs (call, retval); update_stmt (call); } @@ -1676,10 +1609,6 @@ split_function (basic_block return_bb, struct split_point *split_point, { retval = DECL_RESULT (current_function_decl); - if (chkp_function_instrumented_p (current_function_decl) - && BOUNDED_P (retval)) - retbnd = create_tmp_reg (pointer_bounds_type_node); - /* We use temporary register to hold value when aggregate_value_p is false. Similarly for DECL_BY_REFERENCE we must avoid extra copy. */ @@ -1717,9 +1646,6 @@ split_function (basic_block return_bb, struct split_point *split_point, gsi_insert_after (&gsi, g, GSI_NEW_STMT); } } - /* Build bndret call to obtain returned bounds. */ - if (retbnd) - chkp_insert_retbnd_call (retbnd, retval, &gsi); if (tsan_func_exit_call) gsi_insert_after (&gsi, tsan_func_exit_call, GSI_NEW_STMT); ret = gimple_build_return (retval); |