]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Patches to fix sibcall unwind info bugs.
authorDavid Mosberger <davidm@hpl.hp.com>
Fri, 14 Jan 2005 19:15:40 +0000 (19:15 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Fri, 14 Jan 2005 19:15:40 +0000 (11:15 -0800)
PR target/18987
* config/ia64/ia64.c (process_set): For alloc insn, only call
process_epilogue is !frame_pointer_needed.
PR target/13158
* config/ia64/ia64.c (ia64_expand_epilogue): Set RTX_FRAME_RELATED_P on
sibcall alloc instruction.
(process_set): Handle sibcall alloc instruction.

Co-Authored-By: James E Wilson <wilson@specifixinc.com>
From-SVN: r93657

gcc/ChangeLog
gcc/config/ia64/ia64.c

index 64c8bfb590498c8356809d386054bab7a7dadf8c..772c301347b67eb318254acd28bb3cfe29c0f2b8 100644 (file)
@@ -1,3 +1,15 @@
+2004-01-14  David Mosberger  <davidm@hpl.hp.com>
+           James E Wilson  <wilson@specifixinc.com>
+
+       PR target/18987
+       * config/ia64/ia64.c (process_set): For alloc insn, only call
+       process_epilogue is !frame_pointer_needed.
+
+       PR target/13158
+       * config/ia64/ia64.c (ia64_expand_epilogue): Set RTX_FRAME_RELATED_P on
+       sibcall alloc instruction.
+       (process_set): Handle sibcall alloc instruction.
+
 2005-01-13  David O'Brien  <obrien@FreeBSD.org>
 
        Backport from mainline:
index 22507f53127a00e1cacfb713cb5594c532690066..c92a8b12920950634df8fa780bc681d384d4a708 100644 (file)
@@ -2884,10 +2884,13 @@ ia64_expand_epilogue (sibcall_p)
         preserve those input registers used as arguments to the sibling call.
         It is unclear how to compute that number here.  */
       if (current_frame_info.n_input_regs != 0)
-       emit_insn (gen_alloc (gen_rtx_REG (DImode, fp),
-                             GEN_INT (0), GEN_INT (0),
-                             GEN_INT (current_frame_info.n_input_regs),
-                             GEN_INT (0)));
+       {
+         rtx n_inputs = GEN_INT (current_frame_info.n_input_regs);
+         insn = emit_insn (gen_alloc (gen_rtx_REG (DImode, fp),
+                               const0_rtx, const0_rtx,
+                               n_inputs, const0_rtx));
+         RTX_FRAME_RELATED_P (insn) = 1;
+       }
     }
 }
 
@@ -7452,13 +7455,24 @@ process_set (asm_out_file, pat)
     {
       dest_regno = REGNO (dest);
 
-      /* If this isn't the final destination for ar.pfs, the alloc
-        shouldn't have been marked frame related.  */
-      if (dest_regno != current_frame_info.reg_save_ar_pfs)
-       abort ();
-
-      fprintf (asm_out_file, "\t.save ar.pfs, r%d\n",
-              ia64_dbx_register_number (dest_regno));
+      /* If this is the final destination for ar.pfs, then this must
+        be the alloc in the prologue.  */
+      if (dest_regno == current_frame_info.reg_save_ar_pfs)
+       fprintf (asm_out_file, "\t.save ar.pfs, r%d\n",
+                ia64_dbx_register_number (dest_regno));
+      else
+       {
+         /* This must be an alloc before a sibcall.  We must drop the
+            old frame info.  The easiest way to drop the old frame
+            info is to ensure we had a ".restore sp" directive
+            followed by a new prologue.  If the procedure doesn't
+            have a memory-stack frame, we'll issue a dummy ".restore
+            sp" now.  */
+         if (current_frame_info.total_size == 0 && !frame_pointer_needed)
+           /* if haven't done process_epilogue() yet, do it now */
+           process_epilogue ();
+         fprintf (asm_out_file, "\t.prologue\n");
+       }
       return 1;
     }