i960.md (ret): Set PC.
authorJan Hubicka <jh@suse.cz>
Wed, 27 Mar 2002 22:23:12 +0000 (23:23 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Wed, 27 Mar 2002 22:23:12 +0000 (22:23 +0000)
* 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
gcc/builtins.c
gcc/config/i960/i960.md

index 6ad87b7..d59469e 100644 (file)
@@ -1,3 +1,10 @@
+Wed Mar 27 23:19:30 CET 2002  Jan Hubicka  <jh@suse.cz>
+
+       * 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  <jh@suse.cz>
 
        * optabs.c (emit_no_conflict_block, emit_libcall_block): Avoid nesting
index 806dd0d..eb117ce 100644 (file)
@@ -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,
index 80e4efa..5755598 100644 (file)
 ;; 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")
      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;
 }")