]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
stmt.c (expand_goto): A nonlocal goto can be a call too.
authorAndrew MacLeod <amacleod@redhat.com>
Wed, 25 Jul 2001 13:33:17 +0000 (13:33 +0000)
committerAndrew Macleod <amacleod@gcc.gnu.org>
Wed, 25 Jul 2001 13:33:17 +0000 (13:33 +0000)
2001-07-25  Andrew MacLeod  <amacleod@redhat.com>
    Janis Johnson  <janis@us.ibm.com>

* stmt.c (expand_goto): A nonlocal goto can be a call too.
* builtins.c (expand_builtin_longjmp): Reverse label and static chain
pointer parameters to match documented usage of nonlocal_goto.
* config/ia64/ia64.md (nonlocal_goto): Revert label and static chain
parameters to their correct order.
* config/sparc/sparc.md (nonlocal_goto): Revert label and static chain
parameters to their correct order.

Co-Authored-By: Janis Johnson <janis@us.ibm.com>
From-SVN: r44353

gcc/ChangeLog
gcc/builtins.c
gcc/config/ia64/ia64.md
gcc/config/sparc/sparc.md
gcc/stmt.c

index 5d06fdea127b0735cd9e0eb8d105ea0b8de3c138..e8716379fbddfd562caaf860fd628cbd08552cab 100644 (file)
@@ -1,3 +1,14 @@
+2001-07-25  Andrew MacLeod  <amacleod@redhat.com>
+           Janis Johnson  <janis@us.ibm.com>
+
+       * stmt.c (expand_goto): A nonlocal goto can be a call too.
+       * builtins.c (expand_builtin_longjmp): Reverse label and static chain
+       pointer parameters to match documented usage of nonlocal_goto.
+       * config/ia64/ia64.md (nonlocal_goto): Revert label and static chain
+       parameters to their correct order.
+       * config/sparc/sparc.md (nonlocal_goto): Revert label and static chain
+       parameters to their correct order.
+
 2001-07-25  Andrew MacLeod  <amacleod@redhat.com>
 
        * config/ia64/ia64.h (STRIP_NAME_ENCODING): Strip out '*' as well.
index c2ce7c8d49b2cc971d256e98231fea5b2e9cd84f..985324a7375d06ba2c86f1d3dee412ebbd8c1afb 100644 (file)
@@ -696,7 +696,7 @@ expand_builtin_longjmp (buf_addr, value)
        /* We have to pass a value to the nonlocal_goto pattern that will
           get copied into the static_chain pointer, but it does not matter
           what that value is, because builtin_setjmp does not use it.  */
-       emit_insn (gen_nonlocal_goto (value, fp, stack, lab));
+       emit_insn (gen_nonlocal_goto (value, lab, stack, fp));
       else
 #endif
        {
index 8959fbda88da9cdcf0cd45049f4f6ebf796a0a0b..6d1821f012c50a5acca888f0bc8bc695f2069f51 100644 (file)
 {
   emit_library_call (gen_rtx_SYMBOL_REF (Pmode, \"__ia64_nonlocal_goto\"),
                     LCT_NORETURN, VOIDmode, 3,
-                    operands[3], Pmode,
+                    operands[1], Pmode,
                     copy_to_reg (XEXP (operands[2], 0)), Pmode,
-                    operands[1], Pmode);
+                    operands[3], Pmode);
   emit_barrier ();
   DONE;
 }")
index 5a1cb92861ee65ff6069597d3b1655fb7aab195d..51a8e70e8a97549ad64327d6aaa1e370ad2eee3c 100644 (file)
 #if 0
   rtx chain = operands[0];
 #endif
-  rtx fp = operands[1];
+  rtx lab = operands[1];
   rtx stack = operands[2];
-  rtx lab = operands[3];
+  rtx fp = operands[3];
   rtx labreg;
 
   /* Trap instruction to flush all the register windows.  */
index c95db81de4a73ec94ef4293010bf6ae6290a21ba..169291656d98151a0b039e069737104a4a7ee535 100644 (file)
@@ -842,12 +842,17 @@ expand_goto (label)
 
       /* Search backwards to the jump insn and mark it as a 
         non-local goto.  */
-      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));
+      for (insn = get_last_insn (); insn; insn = PREV_INSN (insn))
+       {
+         if (GET_CODE (insn) == JUMP_INSN)
+           {
+             REG_NOTES (insn) = alloc_EXPR_LIST (REG_NON_LOCAL_GOTO,
+                                                 const0_rtx, REG_NOTES (insn));
+             break;
+           }
+         else if (GET_CODE (insn) == CALL_INSN)
+             break;
+       }
     }
   else
     expand_goto_internal (label, label_rtx (label), NULL_RTX);