summaryrefslogtreecommitdiff
path: root/gcc/profile.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-07 20:24:08 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-07 20:24:08 +0000
commit9239aee664338dfa16b622edaa5a9c201e9ffd20 (patch)
tree60a5182f2490898a51da85e16138b7f79e245443 /gcc/profile.c
parent4c088c24ab96eae88be5177016af7a58f9e416b9 (diff)
downloadgcc-9239aee664338dfa16b622edaa5a9c201e9ffd20.tar.gz
* calls.c (expand_call): Do not emit INSN_SETJMP note.
(emit_library_call_value_1): Likewise. (emit_call_1): Emit REG_SETJMP note. * cse.c (cse_end_of_basic_block): Use REG_SETJMP instead of INSN_SETJMP * cselib.c (cselib_process_insn): Likewise. * flow.c (propagate_block): Likewise. * loop.c (find_and_verify_loops): Likewise. * reload.c (find_equiv_regs): Likewise. * reload1.c (reload): Likewise. * resource.c (mark_referenced_resources, mark_set_resources): Likewise. * sched-deps (sched_analyze_insn, sched_analyze): Likewise. * final.c (final_scan_insn): Remove NOTE_INSN_SETJMP. * haifa-sched.c (unlink_other_notes): Likewise. (reemit_notes): Likewise. * sched-ebb.c (sched_ebb): Likewise. * sched-rgc.c (sched_region): Likewise. * rtl.c (note_insn_name): Likewise. (reg_note_name): Add REG_SETJMP * rtl.h (reg_note): Add REG_SETJMP. (insn_note): Remove NOTE_INSN_SETJMP. * profile.c (branch_prob): Add fake edges for setjmp. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44700 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/profile.c')
-rw-r--r--gcc/profile.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/profile.c b/gcc/profile.c
index a872ab850c6..983df4330a7 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -544,8 +544,37 @@ branch_prob ()
int need_exit_edge = 0, need_entry_edge = 0;
int have_exit_edge = 0, have_entry_edge = 0;
basic_block bb = BASIC_BLOCK (i);
+ rtx insn;
edge e;
+ /* Add fake edges from entry block to the call insns that may return
+ twice. The CFG is not quite correct then, as call insn plays more
+ role of CODE_LABEL, but for our purposes, everything should be OK,
+ as we never insert code to the beggining of basic block. */
+ for (insn = bb->head; insn != NEXT_INSN (bb->end);
+ insn = NEXT_INSN (insn))
+ {
+ if (GET_CODE (insn) == CALL_INSN
+ && find_reg_note (insn, REG_SETJMP, NULL))
+ {
+ if (GET_CODE (bb->head) == CODE_LABEL
+ || insn != NEXT_INSN (bb->head))
+ {
+ e = split_block (bb, PREV_INSN (insn));
+ make_edge (NULL, ENTRY_BLOCK_PTR, e->dest, EDGE_FAKE);
+ break;
+ }
+ else
+ {
+ /* We should not get abort here, as call to setjmp should not
+ be the very first instruction of function. */
+ if (!i)
+ abort ();
+ make_edge (NULL, ENTRY_BLOCK_PTR, bb, EDGE_FAKE);
+ }
+ }
+ }
+
for (e = bb->succ; e; e = e->succ_next)
{
if ((e->flags & (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL))