From d337d653ca302134c4e668cdcce30e7518163957 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 27 Mar 2002 23:23:12 +0100 Subject: [PATCH] i960.md (ret): Set PC. * i960.md (ret): Set PC. (nonlocal_goto): Fix expander. * builtins.c (epxand_builin_longjmp): Check that we've emitted some jump or call. From-SVN: r51478 --- gcc/ChangeLog | 7 +++++++ gcc/builtins.c | 5 ++++- gcc/config/i960/i960.md | 5 ++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6ad87b7a00c..d59469ea7bd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +Wed Mar 27 23:19:30 CET 2002 Jan Hubicka + + * i960.md (ret): Set PC. + (nonlocal_goto): Fix expander. + * builtins.c (epxand_builin_longjmp): Check that we've emitted + some jump or call. + Wed Mar 27 23:11:35 CET 2002 Jan Hubicka * optabs.c (emit_no_conflict_block, emit_libcall_block): Avoid nesting diff --git a/gcc/builtins.c b/gcc/builtins.c index 806dd0dc5d2..eb117ceecfe 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -639,7 +639,7 @@ void expand_builtin_longjmp (buf_addr, value) rtx buf_addr, value; { - rtx fp, lab, stack, insn; + rtx fp, lab, stack, insn, last; enum machine_mode sa_mode = STACK_SAVEAREA_MODE (SAVE_NONLOCAL); if (setjmp_alias_set == -1) @@ -662,6 +662,7 @@ expand_builtin_longjmp (buf_addr, value) current_function_calls_longjmp = 1; + last = get_last_insn (); #ifdef HAVE_builtin_longjmp if (HAVE_builtin_longjmp) emit_insn (gen_builtin_longjmp (buf_addr)); @@ -707,6 +708,8 @@ expand_builtin_longjmp (buf_addr, value) internal exception handling use only. */ for (insn = get_last_insn (); insn; insn = PREV_INSN (insn)) { + if (insn == last) + abort (); if (GET_CODE (insn) == JUMP_INSN) { REG_NOTES (insn) = alloc_EXPR_LIST (REG_NON_LOCAL_GOTO, const0_rtx, diff --git a/gcc/config/i960/i960.md b/gcc/config/i960/i960.md index 80e4efaed62..5755598345f 100644 --- a/gcc/config/i960/i960.md +++ b/gcc/config/i960/i960.md @@ -2365,8 +2365,7 @@ ;; stack pointer, frame pointer, previous frame pointer and the return ;; instruction pointer. (define_insn "ret" - [(use (reg:SI 16)) - (unspec_volatile [(const_int 0)] 3)] + [(set (pc) (unspec_volatile [(reg:SI 16)] 3))] "" "ret" [(set_attr "type" "branch") @@ -2424,7 +2423,7 @@ because we are very careful to ret from the exact save area in use during the original call. */ - emit_insn (gen_ret ()); + emit_jump_insn (gen_ret ()); emit_barrier (); DONE; }") -- 2.30.2