diff options
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/gcc/function.c b/gcc/function.c index 87953e335c4..fde4a8e6d07 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -3978,7 +3978,8 @@ regno_clobbered_at_setjmp (bitmap setjmp_crosses, int regno) return false; return ((REG_N_SETS (regno) > 1 - || REGNO_REG_SET_P (df_get_live_out (ENTRY_BLOCK_PTR), regno)) + || REGNO_REG_SET_P (df_get_live_out (ENTRY_BLOCK_PTR_FOR_FN (cfun)), + regno)) && REGNO_REG_SET_P (setjmp_crosses, regno)); } @@ -5400,7 +5401,7 @@ next_block_for_reg (basic_block bb, int regno, int end_regno) /* We can sometimes encounter dead code. Don't try to move it into the exit block. */ - if (!live_edge || live_edge->dest == EXIT_BLOCK_PTR) + if (!live_edge || live_edge->dest == EXIT_BLOCK_PTR_FOR_FN (cfun)) return NULL; /* Reject targets of abnormal edges. This is needed for correctness @@ -5725,7 +5726,7 @@ convert_jumps_to_returns (basic_block last_bb, bool simple_p, src_bbs.create (EDGE_COUNT (last_bb->preds)); FOR_EACH_EDGE (e, ei, last_bb->preds) - if (e->src != ENTRY_BLOCK_PTR) + if (e->src != ENTRY_BLOCK_PTR_FOR_FN (cfun)) src_bbs.quick_push (e->src); label = BB_HEAD (last_bb); @@ -5805,7 +5806,7 @@ convert_jumps_to_returns (basic_block last_bb, bool simple_p, } /* Fix up the CFG for the successful change we just made. */ - redirect_edge_succ (e, EXIT_BLOCK_PTR); + redirect_edge_succ (e, EXIT_BLOCK_PTR_FOR_FN (cfun)); e->flags &= ~EDGE_CROSSING; } src_bbs.release (); @@ -5897,7 +5898,7 @@ thread_prologue_and_epilogue_insns (void) df_analyze (); - rtl_profile_for_bb (ENTRY_BLOCK_PTR); + rtl_profile_for_bb (ENTRY_BLOCK_PTR_FOR_FN (cfun)); inserted = false; seq = NULL_RTX; @@ -5907,8 +5908,8 @@ thread_prologue_and_epilogue_insns (void) /* Can't deal with multiple successors of the entry block at the moment. Function should always have at least one entry point. */ - gcc_assert (single_succ_p (ENTRY_BLOCK_PTR)); - entry_edge = single_succ_edge (ENTRY_BLOCK_PTR); + gcc_assert (single_succ_p (ENTRY_BLOCK_PTR_FOR_FN (cfun))); + entry_edge = single_succ_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun)); orig_entry_edge = entry_edge; split_prologue_seq = NULL_RTX; @@ -6081,7 +6082,7 @@ thread_prologue_and_epilogue_insns (void) basic_block tmp_bb = vec.pop (); FOR_EACH_EDGE (e, ei, tmp_bb->succs) - if (e->dest != EXIT_BLOCK_PTR + if (e->dest != EXIT_BLOCK_PTR_FOR_FN (cfun) && bitmap_set_bit (&bb_flags, e->dest->index)) vec.quick_push (e->dest); } @@ -6089,7 +6090,7 @@ thread_prologue_and_epilogue_insns (void) /* Find the set of basic blocks that need no prologue, have a single successor, can be duplicated, meet a max size requirement, and go to the exit via like blocks. */ - vec.quick_push (EXIT_BLOCK_PTR); + vec.quick_push (EXIT_BLOCK_PTR_FOR_FN (cfun)); while (!vec.is_empty ()) { basic_block tmp_bb = vec.pop (); @@ -6266,7 +6267,7 @@ thread_prologue_and_epilogue_insns (void) { /* Otherwise put the copy at the end of the function. */ copy_bb = create_basic_block (NULL_RTX, NULL_RTX, - EXIT_BLOCK_PTR->prev_bb); + EXIT_BLOCK_PTR_FOR_FN (cfun)->prev_bb); BB_COPY_PARTITION (copy_bb, bb); } @@ -6280,7 +6281,7 @@ thread_prologue_and_epilogue_insns (void) dup_block_and_redirect (tbb, copy_bb, insert_point, &bb_flags); tbb = single_succ (tbb); - if (tbb == EXIT_BLOCK_PTR) + if (tbb == EXIT_BLOCK_PTR_FOR_FN (cfun)) break; e = split_block (copy_bb, PREV_INSN (insert_point)); copy_bb = e->dest; @@ -6294,7 +6295,8 @@ thread_prologue_and_epilogue_insns (void) if (CALL_P (PREV_INSN (insert_point)) && SIBLING_CALL_P (PREV_INSN (insert_point))) eflags = EDGE_SIBCALL | EDGE_ABNORMAL; - make_single_succ_edge (copy_bb, EXIT_BLOCK_PTR, eflags); + make_single_succ_edge (copy_bb, EXIT_BLOCK_PTR_FOR_FN (cfun), + eflags); /* verify_flow_info doesn't like a note after a sibling call. */ @@ -6325,15 +6327,15 @@ thread_prologue_and_epilogue_insns (void) /* If the exit block has no non-fake predecessors, we don't need an epilogue. */ - FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds) + FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR_FOR_FN (cfun)->preds) if ((e->flags & EDGE_FAKE) == 0) break; if (e == NULL) goto epilogue_done; - rtl_profile_for_bb (EXIT_BLOCK_PTR); + rtl_profile_for_bb (EXIT_BLOCK_PTR_FOR_FN (cfun)); - exit_fallthru_edge = find_fallthru_edge (EXIT_BLOCK_PTR->preds); + exit_fallthru_edge = find_fallthru_edge (EXIT_BLOCK_PTR_FOR_FN (cfun)->preds); /* If we're allowed to generate a simple return instruction, then by definition we don't need a full epilogue. If the last basic @@ -6349,10 +6351,10 @@ thread_prologue_and_epilogue_insns (void) /* convert_jumps_to_returns may add to EXIT_BLOCK_PTR->preds (but won't remove). Stop at end of current preds. */ - last = EDGE_COUNT (EXIT_BLOCK_PTR->preds); + last = EDGE_COUNT (EXIT_BLOCK_PTR_FOR_FN (cfun)->preds); for (i = 0; i < last; i++) { - e = EDGE_I (EXIT_BLOCK_PTR->preds, i); + e = EDGE_I (EXIT_BLOCK_PTR_FOR_FN (cfun)->preds, i); if (LABEL_P (BB_HEAD (e->src)) && !bitmap_bit_p (&bb_flags, e->src->index) && !active_insn_between (BB_HEAD (e->src), BB_END (e->src))) @@ -6416,7 +6418,7 @@ thread_prologue_and_epilogue_insns (void) code. In order to be able to properly annotate these with unwind info, try to split them now. If we get a valid split, drop an EPILOGUE_BEG note and mark the insns as epilogue insns. */ - FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds) + FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR_FOR_FN (cfun)->preds) { rtx prev, last, trial; @@ -6507,7 +6509,7 @@ epilogue_done: /* The epilogue insns we inserted may cause the exit edge to no longer be fallthru. */ - FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds) + FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR_FOR_FN (cfun)->preds) { if (((e->flags & EDGE_FALLTHRU) != 0) && returnjump_p (BB_END (e->src))) @@ -6544,7 +6546,7 @@ epilogue_done: } /* Also check returns we might need to add to tail blocks. */ - FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds) + FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR_FOR_FN (cfun)->preds) if (EDGE_COUNT (e->src->preds) != 0 && (e->flags & EDGE_FAKE) != 0 && !bitmap_bit_p (&bb_flags, e->src->index)) @@ -6559,7 +6561,7 @@ epilogue_done: inserting new BBs at the end of the function. Do this after the call to split_block above which may split the original exit pred. */ - exit_pred = EXIT_BLOCK_PTR->prev_bb; + exit_pred = EXIT_BLOCK_PTR_FOR_FN (cfun)->prev_bb; FOR_EACH_VEC_ELT (unconverted_simple_returns, i, e) { @@ -6596,7 +6598,7 @@ epilogue_done: emit_barrier_after (start); *pdest_bb = bb; - make_edge (bb, EXIT_BLOCK_PTR, 0); + make_edge (bb, EXIT_BLOCK_PTR_FOR_FN (cfun), 0); } redirect_edge_and_branch_force (e, *pdest_bb); } @@ -6605,7 +6607,7 @@ epilogue_done: if (entry_edge != orig_entry_edge) { - FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds) + FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR_FOR_FN (cfun)->preds) if (EDGE_COUNT (e->src->preds) != 0 && (e->flags & EDGE_FAKE) != 0 && !bitmap_bit_p (&bb_flags, e->src->index)) @@ -6618,7 +6620,9 @@ epilogue_done: #ifdef HAVE_sibcall_epilogue /* Emit sibling epilogues before any sibling call sites. */ - for (ei = ei_start (EXIT_BLOCK_PTR->preds); (e = ei_safe_edge (ei)); ) + for (ei = ei_start (EXIT_BLOCK_PTR_FOR_FN (cfun)->preds); (e = + ei_safe_edge (ei)); + ) { basic_block bb = e->src; rtx insn = BB_END (bb); @@ -6749,7 +6753,7 @@ reposition_prologue_and_epilogue_notes (void) edge_iterator ei; edge e; - FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds) + FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR_FOR_FN (cfun)->preds) { rtx insn, first = NULL, note = NULL; basic_block bb = e->src; |