This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix 10681, part 3


Finally, the ia64 part.  The ia64_expand_epilogue fragment is enough
to fix the ICE; the rest fix the unnecessary save/load of ar.pfs.


r~


        * config/ia64/ia64.c (ia64_expand_call): Don't add ar.pfs for sibcalls.
        (ia64_split_call): Only load descriptor for GP register inputs.
        (ia64_expand_epilogue): Check current_frame_info.mask not
        current_function_is_leaf to restore ar.pfs.

Index: config/ia64/ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.232
diff -u -p -r1.232 ia64.c
--- config/ia64/ia64.c	19 Jun 2003 21:47:13 -0000	1.232
+++ config/ia64/ia64.c	26 Jun 2003 20:48:56 -0000
@@ -1499,11 +1499,7 @@ ia64_expand_call (retval, addr, nextarg,
     }
 
   if (sibcall_p)
-    {
-      use_reg (&CALL_INSN_FUNCTION_USAGE (insn), b0);
-      use_reg (&CALL_INSN_FUNCTION_USAGE (insn),
-	       gen_rtx_REG (DImode, AR_PFS_REGNUM));
-    }
+    use_reg (&CALL_INSN_FUNCTION_USAGE (insn), b0);
 }
 
 void
@@ -1557,7 +1553,7 @@ ia64_split_call (retval, addr, retaddr, 
 
   /* If we find we're calling through a register, then we're actually
      calling through a descriptor, so load up the values.  */
-  if (REG_P (addr))
+  if (REG_P (addr) && GR_REGNO_P (REGNO (addr)))
     {
       rtx tmp;
       bool addr_dead_p;
@@ -2785,7 +2781,7 @@ ia64_expand_epilogue (sibcall_p)
       reg = gen_rtx_REG (DImode, AR_PFS_REGNUM);
       emit_move_insn (reg, alt_reg);
     }
-  else if (! current_function_is_leaf)
+  else if (TEST_HARD_REG_BIT (current_frame_info.mask, AR_PFS_REGNUM))
     {
       alt_regno = next_scratch_gr_reg ();
       alt_reg = gen_rtx_REG (DImode, alt_regno);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]