Fix alloca on NT
authorMichael Meissner <meissner@gcc.gnu.org>
Thu, 15 Feb 1996 23:35:34 +0000 (23:35 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Thu, 15 Feb 1996 23:35:34 +0000 (23:35 +0000)
From-SVN: r11280

gcc/config/rs6000/rs6000.md

index f3476bd54899e648787144004b45f9865a6bab78..38ce9eb6fbb0e95132bab283c01acc558b606ee9 100644 (file)
   if (DEFAULT_ABI == ABI_NT
       && (GET_CODE (operands[0]) != CONST_INT || INTVAL (operands[0]) > 4096))
     {
-      emit_library_call (gen_rtx (SYMBOL_REF, Pmode, \"__allocate_stack\"), 0,
-                        VOIDmode, 1,
-                        operands[0], Pmode);
+      rtx tmp = gen_reg_rtx (SImode);
+      emit_library_call_value (gen_rtx (SYMBOL_REF, Pmode, \"__allocate_stack\"),
+                              tmp, 0, SImode, 1, operands[0], Pmode);
+      emit_insn (gen_set_sp (tmp));
       DONE;
     }
 
   DONE;
 }")
 
+;; Marker to indicate that the stack pointer was changed under NT in
+;; ways not known to the compiler
+
+(define_insn "set_sp"
+  [(set (reg:SI 1)
+       (unspec [(match_operand:SI 0 "register_operand" "r")] 7))]
+  ""
+  ""
+  [(set_attr "length" "0")])
+
 ;; These patterns say how to save and restore the stack pointer.  We need not
 ;; save the stack pointer at function level since we are careful to
 ;; preserve the backchain.  At block level, we have to restore the backchain