aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2001-08-07 22:24:08 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2001-08-07 20:24:08 +0000
commit570a98eb7c116ea107e1c2167da244782cc4b988 (patch)
tree60a5182f2490898a51da85e16138b7f79e245443 /gcc
parentff25793cc1ffe5114b6ce07b44c75698d12ab0b2 (diff)
downloadgcc-570a98eb7c116ea107e1c2167da244782cc4b988.zip
gcc-570a98eb7c116ea107e1c2167da244782cc4b988.tar.gz
gcc-570a98eb7c116ea107e1c2167da244782cc4b988.tar.bz2
calls.c (expand_call): Do not emit INSN_SETJMP note.
* 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. From-SVN: r44700
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog27
-rw-r--r--gcc/calls.c28
-rw-r--r--gcc/cse.c7
-rw-r--r--gcc/cselib.c4
-rw-r--r--gcc/final.c1
-rw-r--r--gcc/flow.c4
-rw-r--r--gcc/haifa-sched.c16
-rw-r--r--gcc/loop.c28
-rw-r--r--gcc/profile.c29
-rw-r--r--gcc/reload.c8
-rw-r--r--gcc/reload1.c5
-rw-r--r--gcc/resource.c19
-rw-r--r--gcc/rtl.c4
-rw-r--r--gcc/rtl.h10
-rw-r--r--gcc/sched-deps.c40
-rw-r--r--gcc/sched-ebb.c16
-rw-r--r--gcc/sched-rgn.c16
17 files changed, 132 insertions, 130 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f4d6585..669297e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,30 @@
+Tue Aug 7 22:18:06 CEST 2001 Jan Hubicka <jh@suse.cz>
+
+ * 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.
+
2001-08-07 Daniel Jacobowitz <drow@mvista.com>
* config.gcc: Quote target_cpu_default2 correctly for
diff --git a/gcc/calls.c b/gcc/calls.c
index e31900f..8206b9c 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -610,6 +610,10 @@ emit_call_1 (funexp, fndecl, funtype, stack_size, rounded_stack_size,
REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_NORETURN, const0_rtx,
REG_NOTES (call_insn));
+ if (ecf_flags & ECF_RETURNS_TWICE)
+ REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_SETJMP, const0_rtx,
+ REG_NOTES (call_insn));
+
SIBLING_CALL_P (call_insn) = ((ecf_flags & ECF_SIBCALL) != 0);
/* Restore this now, so that we do defer pops for this call's args
@@ -3152,9 +3156,9 @@ expand_call (exp, target, ignore)
if nonvolatile values are live. For functions that cannot return,
inform flow that control does not fall through. */
- if ((flags & (ECF_RETURNS_TWICE | ECF_NORETURN | ECF_LONGJMP)) || pass == 0)
+ if ((flags & (ECF_NORETURN | ECF_LONGJMP)) || pass == 0)
{
- /* The barrier or NOTE_INSN_SETJMP note must be emitted
+ /* The barrier must be emitted
immediately after the CALL_INSN. Some ports emit more
than just a CALL_INSN above, so we must search for it here. */
@@ -3167,13 +3171,7 @@ expand_call (exp, target, ignore)
abort ();
}
- if (flags & ECF_RETURNS_TWICE)
- {
- emit_note_after (NOTE_INSN_SETJMP, last);
- current_function_calls_setjmp = 1;
- }
- else
- emit_barrier_after (last);
+ emit_barrier_after (last);
}
if (flags & ECF_LONGJMP)
@@ -4086,9 +4084,9 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
if nonvolatile values are live. For functions that cannot return,
inform flow that control does not fall through. */
- if (flags & (ECF_RETURNS_TWICE | ECF_NORETURN | ECF_LONGJMP))
+ if (flags & (ECF_NORETURN | ECF_LONGJMP))
{
- /* The barrier or NOTE_INSN_SETJMP note must be emitted
+ /* The barrier note must be emitted
immediately after the CALL_INSN. Some ports emit more than
just a CALL_INSN above, so we must search for it here. */
@@ -4101,13 +4099,7 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
abort ();
}
- if (flags & ECF_RETURNS_TWICE)
- {
- emit_note_after (NOTE_INSN_SETJMP, last);
- current_function_calls_setjmp = 1;
- }
- else
- emit_barrier_after (last);
+ emit_barrier_after (last);
}
/* Now restore inhibit_defer_pop to its actual original value. */
diff --git a/gcc/cse.c b/gcc/cse.c
index ade5b80..f5b1afa 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -6855,8 +6855,8 @@ cse_end_of_basic_block (insn, data, follow_jumps, after_loop, skip_blocks)
/* Don't cse over a call to setjmp; on some machines (eg VAX)
the regs restored by the longjmp come from
a later time than the setjmp. */
- if (GET_CODE (p) == NOTE
- && NOTE_LINE_NUMBER (p) == NOTE_INSN_SETJMP)
+ if (PREV_INSN (p) && GET_CODE (PREV_INSN (p)) == CALL_INSN
+ && find_reg_note (PREV_INSN (p), REG_SETJMP, NULL))
break;
/* A PARALLEL can have lots of SETs in it,
@@ -6906,7 +6906,8 @@ cse_end_of_basic_block (insn, data, follow_jumps, after_loop, skip_blocks)
for (q = PREV_INSN (JUMP_LABEL (p)); q; q = PREV_INSN (q))
if ((GET_CODE (q) != NOTE
|| NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_END
- || NOTE_LINE_NUMBER (q) == NOTE_INSN_SETJMP)
+ || (PREV_INSN (q) && GET_CODE (PREV_INSN (q)) == CALL_INSN
+ && find_reg_note (PREV_INSN (q), REG_SETJMP, NULL)))
&& (GET_CODE (q) != CODE_LABEL || LABEL_NUSES (q) != 0))
break;
diff --git a/gcc/cselib.c b/gcc/cselib.c
index e6d5b2a..6497de0 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -1254,8 +1254,8 @@ cselib_process_insn (insn)
/* Forget everything at a CODE_LABEL, a volatile asm, or a setjmp. */
if (GET_CODE (insn) == CODE_LABEL
- || (GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP)
+ || (GET_CODE (insn) == CALL
+ && find_reg_note (insn, REG_SETJMP, NULL))
|| (GET_CODE (insn) == INSN
&& GET_CODE (PATTERN (insn)) == ASM_OPERANDS
&& MEM_VOLATILE_P (PATTERN (insn))))
diff --git a/gcc/final.c b/gcc/final.c
index 7598c1d..d3215ad 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -2011,7 +2011,6 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
case NOTE_INSN_LOOP_CONT:
case NOTE_INSN_LOOP_VTOP:
case NOTE_INSN_FUNCTION_END:
- case NOTE_INSN_SETJMP:
case NOTE_INSN_REPEATED_LINE_NUMBER:
case NOTE_INSN_RANGE_BEG:
case NOTE_INSN_RANGE_END:
diff --git a/gcc/flow.c b/gcc/flow.c
index b2c9087..b219ef6 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -5706,8 +5706,8 @@ propagate_block (bb, live, local_set, cond_local_set, flags)
/* If this is a call to `setjmp' et al, warn if any
non-volatile datum is live. */
if ((flags & PROP_REG_INFO)
- && GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP)
+ && GET_CODE (insn) == CALL
+ && find_reg_note (insn, REG_SETJMP, NULL))
IOR_REG_SET (regs_live_at_setjmp, pbi->reg_live);
prev = propagate_one_insn (pbi, insn);
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index c8fb5f7..46993fb 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -1071,8 +1071,7 @@ unlink_other_notes (insn, tail)
PREV_INSN (next) = prev;
/* See sched_analyze to see how these are handled. */
- if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_SETJMP
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_BEG
+ if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_BEG
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_END
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_RANGE_BEG
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_RANGE_END
@@ -1537,7 +1536,7 @@ move_insn1 (insn, last)
return insn;
}
-/* Search INSN for REG_SAVE_NOTE note pairs for NOTE_INSN_SETJMP,
+/* Search INSN for REG_SAVE_NOTE note pairs for
NOTE_INSN_{LOOP,EHREGION}_{BEG,END}; and convert them back into
NOTEs. The REG_SAVE_NOTE note following first one is contains the
saved value for NOTE_BLOCK_NUMBER which is useful for
@@ -1558,15 +1557,8 @@ reemit_notes (insn, last)
{
enum insn_note note_type = INTVAL (XEXP (note, 0));
- if (note_type == NOTE_INSN_SETJMP)
- {
- retval = emit_note_after (NOTE_INSN_SETJMP, insn);
- CONST_OR_PURE_CALL_P (retval) = CONST_OR_PURE_CALL_P (note);
- remove_note (insn, note);
- note = XEXP (note, 1);
- }
- else if (note_type == NOTE_INSN_RANGE_BEG
- || note_type == NOTE_INSN_RANGE_END)
+ if (note_type == NOTE_INSN_RANGE_BEG
+ || note_type == NOTE_INSN_RANGE_END)
{
last = emit_note_before (note_type, last);
remove_note (insn, note);
diff --git a/gcc/loop.c b/gcc/loop.c
index 50b430d..46225bb 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -2512,19 +2512,6 @@ find_and_verify_loops (f, loops)
current_loop = next_loop;
break;
- case NOTE_INSN_SETJMP:
- /* In this case, we must invalidate our current loop and any
- enclosing loop. */
- for (loop = current_loop; loop; loop = loop->outer)
- {
- loop->invalid = 1;
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "\nLoop at %d ignored due to setjmp.\n",
- INSN_UID (loop->start));
- }
- break;
-
case NOTE_INSN_LOOP_CONT:
current_loop->cont = insn;
break;
@@ -2545,6 +2532,21 @@ find_and_verify_loops (f, loops)
break;
}
+ if (GET_CODE (insn) == CALL
+ && find_reg_note (insn, REG_SETJMP, NULL))
+ {
+ /* In this case, we must invalidate our current loop and any
+ enclosing loop. */
+ for (loop = current_loop; loop; loop = loop->outer)
+ {
+ loop->invalid = 1;
+ if (loop_dump_stream)
+ fprintf (loop_dump_stream,
+ "\nLoop at %d ignored due to setjmp.\n",
+ INSN_UID (loop->start));
+ }
+ }
+
/* Note that this will mark the NOTE_INSN_LOOP_END note as being in the
enclosing loop, but this doesn't matter. */
uid_loop[INSN_UID (insn)] = current_loop;
diff --git a/gcc/profile.c b/gcc/profile.c
index a872ab8..983df43 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))
diff --git a/gcc/reload.c b/gcc/reload.c
index 94cd337..a569ab8 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -6461,13 +6461,11 @@ find_equiv_reg (goal, insn, class, other, reload_reg_p, goalreg, mode)
for (i = 0; i < valuenregs; ++i)
if (call_used_regs[valueno + i])
return 0;
- }
-
#ifdef NON_SAVING_SETJMP
- if (NON_SAVING_SETJMP && GET_CODE (p) == NOTE
- && NOTE_LINE_NUMBER (p) == NOTE_INSN_SETJMP)
- return 0;
+ if (NON_SAVING_SETJMP && find_reg_note (p, REG_SETJMP, NULL))
+ return 0;
#endif
+ }
if (INSN_P (p))
{
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 86b6354..d405b10 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -754,7 +754,7 @@ reload (first, global)
Also find all paradoxical subregs and find largest such for each pseudo.
On machines with small register classes, record hard registers that
are used for user variables. These can never be used for spills.
- Also look for a "constant" NOTE_INSN_SETJMP. This means that all
+ Also look for a "constant" REG_SETJMP. This means that all
caller-saved registers must be marked live. */
num_eliminable_invariants = 0;
@@ -762,8 +762,7 @@ reload (first, global)
{
rtx set = single_set (insn);
- if (GET_CODE (insn) == NOTE && CONST_OR_PURE_CALL_P (insn)
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP)
+ if (GET_CODE (insn) == CALL && find_reg_note (insn, REG_SETJMP, NULL))
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (! call_used_regs[i])
regs_ever_live[i] = 1;
diff --git a/gcc/resource.c b/gcc/resource.c
index 17f7d03..7a16e8b 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -326,13 +326,11 @@ mark_referenced_resources (x, res, include_delayed_effects)
rtx insn = PREV_INSN (x);
rtx sequence = 0;
int seq_size = 0;
- rtx next = NEXT_INSN (x);
int i;
/* If we are part of a delay slot sequence, point at the SEQUENCE. */
if (NEXT_INSN (insn) != x)
{
- next = NEXT_INSN (NEXT_INSN (insn));
sequence = PATTERN (NEXT_INSN (insn));
seq_size = XVECLEN (sequence, 0);
if (GET_CODE (sequence) != SEQUENCE)
@@ -353,7 +351,7 @@ mark_referenced_resources (x, res, include_delayed_effects)
if (global_regs[i])
SET_HARD_REG_BIT (res->regs, i);
- /* Check for a NOTE_INSN_SETJMP. If it exists, then we must
+ /* Check for a REG_SETJMP. If it exists, then we must
assume that this call can need any register.
This is done to be more conservative about how we handle setjmp.
@@ -361,8 +359,7 @@ mark_referenced_resources (x, res, include_delayed_effects)
registers ensures that a register will not be considered dead
just because it crosses a setjmp call. A register should be
considered dead only if the setjmp call returns non-zero. */
- if (next && GET_CODE (next) == NOTE
- && NOTE_LINE_NUMBER (next) == NOTE_INSN_SETJMP)
+ if (find_reg_note (x, REG_SETJMP, NULL))
SET_HARD_REG_SET (res->regs);
{
@@ -667,8 +664,6 @@ mark_set_resources (x, res, in_dest, mark_type)
if (mark_type == MARK_SRC_DEST_CALL)
{
- rtx next = NEXT_INSN (x);
- rtx prev = PREV_INSN (x);
rtx link;
res->cc = res->memory = 1;
@@ -676,21 +671,15 @@ mark_set_resources (x, res, in_dest, mark_type)
if (call_used_regs[r] || global_regs[r])
SET_HARD_REG_BIT (res->regs, r);
- /* If X is part of a delay slot sequence, then NEXT should be
- the first insn after the sequence. */
- if (NEXT_INSN (prev) != x)
- next = NEXT_INSN (NEXT_INSN (prev));
-
for (link = CALL_INSN_FUNCTION_USAGE (x);
link; link = XEXP (link, 1))
if (GET_CODE (XEXP (link, 0)) == CLOBBER)
mark_set_resources (SET_DEST (XEXP (link, 0)), res, 1,
MARK_SRC_DEST);
- /* Check for a NOTE_INSN_SETJMP. If it exists, then we must
+ /* Check for a REG_SETJMP. If it exists, then we must
assume that this call can clobber any register. */
- if (next && GET_CODE (next) == NOTE
- && NOTE_LINE_NUMBER (next) == NOTE_INSN_SETJMP)
+ if (find_reg_note (x, REG_SETJMP, NULL))
SET_HARD_REG_SET (res->regs);
}
diff --git a/gcc/rtl.c b/gcc/rtl.c
index c5dcb26..74b58d1 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -263,7 +263,7 @@ const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS] =
"NOTE_INSN_BLOCK_BEG", "NOTE_INSN_BLOCK_END",
"NOTE_INSN_LOOP_BEG", "NOTE_INSN_LOOP_END",
"NOTE_INSN_LOOP_CONT", "NOTE_INSN_LOOP_VTOP",
- "NOTE_INSN_FUNCTION_END", "NOTE_INSN_SETJMP",
+ "NOTE_INSN_FUNCTION_END",
"NOTE_INSN_PROLOGUE_END", "NOTE_INSN_EPILOGUE_BEG",
"NOTE_INSN_DELETED_LABEL", "NOTE_INSN_FUNCTION_BEG",
"NOTE_INSN_EH_REGION_BEG", "NOTE_INSN_EH_REGION_END",
@@ -281,7 +281,7 @@ const char * const reg_note_name[] =
"REG_EXEC_COUNT", "REG_NOALIAS", "REG_SAVE_AREA", "REG_BR_PRED",
"REG_FRAME_RELATED_EXPR", "REG_EH_CONTEXT", "REG_EH_REGION",
"REG_EH_RETHROW", "REG_SAVE_NOTE", "REG_MAYBE_DEAD", "REG_NORETURN",
- "REG_NON_LOCAL_GOTO"
+ "REG_NON_LOCAL_GOTO", "REG_SETJMP"
};
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 9e707da..92c0133 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -562,7 +562,11 @@ enum reg_note
/* Indicates that an indirect jump is a non-local goto instead of a
computed goto. */
- REG_NON_LOCAL_GOTO
+ REG_NON_LOCAL_GOTO,
+
+ /* This kind of note is generated at each to `setjmp',
+ and similar functions that can return twice. */
+ REG_SETJMP
};
/* The base value for branch probability notes. */
@@ -660,10 +664,6 @@ enum insn_note
off the end of the function body without a return statement. */
NOTE_INSN_FUNCTION_END,
- /* This kind of note is generated just after each call to `setjmp',
- and similar functions that can return twice. */
- NOTE_INSN_SETJMP,
-
/* This marks the point immediately after the last prologue insn. */
NOTE_INSN_PROLOGUE_END,
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index 69397a9..0893ee1 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -1017,13 +1017,17 @@ sched_analyze_insn (deps, x, insn, loop_notes)
/* Mark registers CLOBBERED or used by called function. */
if (GET_CODE (insn) == CALL_INSN)
- for (link = CALL_INSN_FUNCTION_USAGE (insn); link; link = XEXP (link, 1))
- {
- if (GET_CODE (XEXP (link, 0)) == CLOBBER)
- sched_analyze_1 (deps, XEXP (link, 0), insn);
- else
- sched_analyze_2 (deps, XEXP (link, 0), insn);
- }
+ {
+ for (link = CALL_INSN_FUNCTION_USAGE (insn); link; link = XEXP (link, 1))
+ {
+ if (GET_CODE (XEXP (link, 0)) == CLOBBER)
+ sched_analyze_1 (deps, XEXP (link, 0), insn);
+ else
+ sched_analyze_2 (deps, XEXP (link, 0), insn);
+ }
+ if (find_reg_note (insn, REG_SETJMP, NULL))
+ schedule_barrier_found = 1;
+ }
if (GET_CODE (insn) == JUMP_INSN)
{
@@ -1094,8 +1098,7 @@ sched_analyze_insn (deps, x, insn, loop_notes)
if (INTVAL (XEXP (link, 0)) == NOTE_INSN_LOOP_BEG
|| INTVAL (XEXP (link, 0)) == NOTE_INSN_LOOP_END
|| INTVAL (XEXP (link, 0)) == NOTE_INSN_EH_REGION_BEG
- || INTVAL (XEXP (link, 0)) == NOTE_INSN_EH_REGION_END
- || INTVAL (XEXP (link, 0)) == NOTE_INSN_SETJMP)
+ || INTVAL (XEXP (link, 0)) == NOTE_INSN_EH_REGION_END)
schedule_barrier_found = 1;
link = XEXP (link, 1);
@@ -1277,15 +1280,14 @@ sched_analyze (deps, head, tail)
past a void call (i.e. it does not explicitly set the hard
return reg). */
- /* If this call is followed by a NOTE_INSN_SETJMP, then assume that
+ /* If this call has REG_SETJMP, then assume that
all registers, not just hard registers, may be clobbered by this
call. */
/* Insn, being a CALL_INSN, magically depends on
`last_function_call' already. */
- if (NEXT_INSN (insn) && GET_CODE (NEXT_INSN (insn)) == NOTE
- && NOTE_LINE_NUMBER (NEXT_INSN (insn)) == NOTE_INSN_SETJMP)
+ if (find_reg_note (insn, REG_SETJMP, NULL))
{
for (i = 0; i < deps->max_reg; i++)
{
@@ -1301,16 +1303,6 @@ sched_analyze (deps, head, tail)
free_INSN_LIST_list (&reg_last->uses);
}
reg_pending_sets_all = 1;
-
- /* Add a pair of REG_SAVE_NOTEs which we will later
- convert back into a NOTE_INSN_SETJMP note. See
- reemit_notes for why we use a pair of NOTEs. */
- REG_NOTES (insn) = alloc_EXPR_LIST (REG_SAVE_NOTE,
- GEN_INT (0),
- REG_NOTES (insn));
- REG_NOTES (insn) = alloc_EXPR_LIST (REG_SAVE_NOTE,
- GEN_INT (NOTE_INSN_SETJMP),
- REG_NOTES (insn));
}
else
{
@@ -1375,9 +1367,7 @@ sched_analyze (deps, head, tail)
&& (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG
|| NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END
|| NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END
- || (NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP
- && GET_CODE (PREV_INSN (insn)) != CALL_INSN)))
+ || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END))
{
rtx rtx_region;
diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c
index 56d9661..2ea9029 100644
--- a/gcc/sched-ebb.c
+++ b/gcc/sched-ebb.c
@@ -236,10 +236,7 @@ schedule_ebb (head, tail)
or after the last real insn of the block. So if the first insn
has a REG_SAVE_NOTE which would otherwise be emitted before the
insn, it is redundant with the note before the start of the
- block, and so we have to take it out.
-
- FIXME: Probably the same thing should be done with REG_SAVE_NOTEs
- referencing NOTE_INSN_SETJMP at the end of the block. */
+ block, and so we have to take it out. */
if (INSN_P (head))
{
rtx note;
@@ -247,14 +244,9 @@ schedule_ebb (head, tail)
for (note = REG_NOTES (head); note; note = XEXP (note, 1))
if (REG_NOTE_KIND (note) == REG_SAVE_NOTE)
{
- if (INTVAL (XEXP (note, 0)) != NOTE_INSN_SETJMP)
- {
- remove_note (head, note);
- note = XEXP (note, 1);
- remove_note (head, note);
- }
- else
- note = XEXP (note, 1);
+ remove_note (head, note);
+ note = XEXP (note, 1);
+ remove_note (head, note);
}
}
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index 41989cc..93f7b44 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -2809,10 +2809,7 @@ schedule_region (rgn)
or after the last real insn of the block. So if the first insn
has a REG_SAVE_NOTE which would otherwise be emitted before the
insn, it is redundant with the note before the start of the
- block, and so we have to take it out.
-
- FIXME: Probably the same thing should be done with REG_SAVE_NOTEs
- referencing NOTE_INSN_SETJMP at the end of the block. */
+ block, and so we have to take it out. */
if (INSN_P (head))
{
rtx note;
@@ -2820,14 +2817,9 @@ schedule_region (rgn)
for (note = REG_NOTES (head); note; note = XEXP (note, 1))
if (REG_NOTE_KIND (note) == REG_SAVE_NOTE)
{
- if (INTVAL (XEXP (note, 0)) != NOTE_INSN_SETJMP)
- {
- remove_note (head, note);
- note = XEXP (note, 1);
- remove_note (head, note);
- }
- else
- note = XEXP (note, 1);
+ remove_note (head, note);
+ note = XEXP (note, 1);
+ remove_note (head, note);
}
}