summaryrefslogtreecommitdiffstats
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2000-12-21 01:11:31 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2000-12-21 01:11:31 +0000
commit615166bb45272b0ad86b04ff1a7d65770ed5f4f9 (patch)
treeffba52aed7e19dec753b233566b9ab484e11d29e /gcc/builtins.c
parent4e8b9dce686f20aa5ba3bfc67afc0725adff1694 (diff)
downloadppe42-gcc-615166bb45272b0ad86b04ff1a7d65770ed5f4f9.tar.gz
ppe42-gcc-615166bb45272b0ad86b04ff1a7d65770ed5f4f9.zip
* rtl.h (REG_NON_LOCAL_GOTO): New.
* rtl.c (reg_note_name): Update. * stmt.c (expand_goto): Emit a REG_NON_LOCAL_GOTO note. * builtins.c (expand_builtin_longjmp): Likewise. * flow.c (make_edges): Check for REG_NON_LOCAL_GOTO and do not emit an edge. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38408 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index cbf9acd55de..3d746814298 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -649,7 +649,7 @@ void
expand_builtin_longjmp (buf_addr, value)
rtx buf_addr, value;
{
- rtx fp, lab, stack;
+ rtx fp, lab, stack, insn;
enum machine_mode sa_mode = STACK_SAVEAREA_MODE (SAVE_NONLOCAL);
if (setjmp_alias_set == -1)
@@ -706,6 +706,18 @@ expand_builtin_longjmp (buf_addr, value)
emit_indirect_jump (lab);
}
}
+
+ /* Search backwards and mark the jump insn as a non-local goto.
+ Note that this precludes the use of __builtin_longjmp to a
+ __builtin_setjmp target in the same function. However, we've
+ already cautioned the user that these functions are for
+ internal exception handling use only. */
+ for (insn = get_last_insn ();
+ GET_CODE (insn) != JUMP_INSN;
+ insn = PREV_INSN (insn))
+ continue;
+ REG_NOTES (insn) = alloc_EXPR_LIST (REG_NON_LOCAL_GOTO, const0_rtx,
+ REG_NOTES (insn));
}
/* Get a MEM rtx for expression EXP which is the address of an operand
OpenPOWER on IntegriCloud