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]

ia64 eh, part 24


Update the sparc port for the changes to eh_return.

Th-th-th-that's all, folks.  Other chips will be updated asap.

Ports (particularly operating systems) that undef'ed 
DWARF2_UNWIND_INFO for binary compatibility with older
releases will have that undef removed soon.


r~


        * config/sparc/sparc.c (eligible_for_epilogue_delay): False if
        current_function_calls_eh_return.
        (output_function_epilogue): Handle eh_return.
        * config/sparc/sparc.h (DOESNT_NEED_UNWINDER): Remove.
        (EH_RETURN_DATA_REGNO): New.
        (EH_RETURN_STACKADJ_RTX): New.
        (EH_RETURN_HANDLER_RTX): New.
        * config/sparc/sparc.md (call/short branch peepholes): Check    
        can_throw_internal instead of in_same_eh_region.

Index: config/sparc/sparc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.c,v
retrieving revision 1.138
diff -c -p -d -r1.138 sparc.c
*** sparc.c	2001/03/22 18:48:51	1.138
--- sparc.c	2001/03/28 11:20:10
*************** eligible_for_epilogue_delay (trial, slot
*** 2377,2382 ****
--- 2377,2387 ----
    if (num_gfregs)
      return 0;
  
+   /* If the function uses __builtin_eh_return, the eh_return machinery
+      occupies the delay slot.  */
+   if (current_function_calls_eh_return)
+     return 0;
+ 
    /* In the case of a true leaf function, anything can go into the delay slot.
       A delay slot only exists however if the frame size is zero, otherwise
       we will put an insn to adjust the stack after the return.  */
*************** output_function_epilogue (file, size, le
*** 3594,3601 ****
  
        if (! leaf_function)
  	{
  	  /* If we wound up with things in our delay slot, flush them here.  */
! 	  if (current_function_epilogue_delay_list)
  	    {
  	      rtx delay = PATTERN (XEXP (current_function_epilogue_delay_list, 0));
  
--- 3599,3615 ----
  
        if (! leaf_function)
  	{
+ 	  if (current_function_calls_eh_return)
+ 	    {
+ 	      if (current_function_epilogue_delay_list)
+ 		abort ();
+ 	      if (SKIP_CALLERS_UNIMP_P)
+ 		abort ();
+ 
+ 	      fputs ("\trestore\n\tretl\n\tadd\t%sp, %g1, %sp\n", file);
+ 	    }
  	  /* If we wound up with things in our delay slot, flush them here.  */
! 	  else if (current_function_epilogue_delay_list)
  	    {
  	      rtx delay = PATTERN (XEXP (current_function_epilogue_delay_list, 0));
  
*************** output_function_epilogue (file, size, le
*** 3635,3640 ****
--- 3649,3656 ----
  	  else
  	    fprintf (file, "\t%s\n\trestore\n", ret);
  	}
+       else if (current_function_calls_eh_return)
+ 	abort ();
        /* All of the following cases are for leaf functions.  */
        else if (current_function_epilogue_delay_list)
  	{
Index: config/sparc/sparc.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.h,v
retrieving revision 1.131
diff -c -p -d -r1.131 sparc.h
*** sparc.h	2001/01/04 18:54:14	1.131
--- sparc.h	2001/03/28 11:20:10
*************** LFLGRET"ID":\n\
*** 2235,2241 ****
     bias if present.  */
  #define INCOMING_FRAME_SP_OFFSET SPARC_STACK_BIAS
  
! #define DOESNT_NEED_UNWINDER (! TARGET_FLAT)
  
  /* Addressing modes, and classification of registers for them.  */
  
--- 2235,2244 ----
     bias if present.  */
  #define INCOMING_FRAME_SP_OFFSET SPARC_STACK_BIAS
  
! /* Describe how we implement __builtin_eh_return.  */
! #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 24 : INVALID_REGNUM)
! #define EH_RETURN_STACKADJ_RTX	gen_rtx_REG (Pmode, 1)	/* %g1 */
! #define EH_RETURN_HANDLER_RTX	gen_rtx_REG (Pmode, 31)	/* %i7 */
  
  /* Addressing modes, and classification of registers for them.  */
  
Index: config/sparc/sparc.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.md,v
retrieving revision 1.121
diff -c -p -d -r1.121 sparc.md
*** sparc.md	2001/02/13 08:46:52	1.121
--- sparc.md	2001/03/28 11:20:10
***************
*** 9453,9460 ****
  	      (clobber (reg:SI 15))])
     (set (pc) (label_ref (match_operand 3 "" "")))]
    "short_branch (INSN_UID (insn), INSN_UID (operands[3]))
!    && in_same_eh_region (insn, operands[3])
!    && in_same_eh_region (insn, ins1)"
    "call\\t%a1, %2\\n\\tadd\\t%%o7, (%l3-.-4), %%o7")
  
  (define_peephole
--- 9453,9459 ----
  	      (clobber (reg:SI 15))])
     (set (pc) (label_ref (match_operand 3 "" "")))]
    "short_branch (INSN_UID (insn), INSN_UID (operands[3]))
!    && (USING_SJLJ_EXCEPTIONS || ! can_throw_internal (insn))"
    "call\\t%a1, %2\\n\\tadd\\t%%o7, (%l3-.-4), %%o7")
  
  (define_peephole
***************
*** 9463,9470 ****
  	      (clobber (reg:SI 15))])
     (set (pc) (label_ref (match_operand 2 "" "")))]
    "short_branch (INSN_UID (insn), INSN_UID (operands[2]))
!    && in_same_eh_region (insn, operands[2])
!    && in_same_eh_region (insn, ins1)"
    "call\\t%a0, %1\\n\\tadd\\t%%o7, (%l2-.-4), %%o7")
  
  (define_peephole
--- 9462,9468 ----
  	      (clobber (reg:SI 15))])
     (set (pc) (label_ref (match_operand 2 "" "")))]
    "short_branch (INSN_UID (insn), INSN_UID (operands[2]))
!    && (USING_SJLJ_EXCEPTIONS || ! can_throw_internal (insn))"
    "call\\t%a0, %1\\n\\tadd\\t%%o7, (%l2-.-4), %%o7")
  
  (define_peephole
***************
*** 9475,9482 ****
     (set (pc) (label_ref (match_operand 3 "" "")))]
    "TARGET_ARCH64
     && short_branch (INSN_UID (insn), INSN_UID (operands[3]))
!    && in_same_eh_region (insn, operands[3])
!    && in_same_eh_region (insn, ins1)"
    "call\\t%a1, %2\\n\\tadd\\t%%o7, (%l3-.-4), %%o7")
  
  (define_peephole
--- 9473,9479 ----
     (set (pc) (label_ref (match_operand 3 "" "")))]
    "TARGET_ARCH64
     && short_branch (INSN_UID (insn), INSN_UID (operands[3]))
!    && (USING_SJLJ_EXCEPTIONS || ! can_throw_internal (insn))"
    "call\\t%a1, %2\\n\\tadd\\t%%o7, (%l3-.-4), %%o7")
  
  (define_peephole
***************
*** 9486,9493 ****
     (set (pc) (label_ref (match_operand 2 "" "")))]
    "TARGET_ARCH64
     && short_branch (INSN_UID (insn), INSN_UID (operands[2]))
!    && in_same_eh_region (insn, operands[2])
!    && in_same_eh_region (insn, ins1)"
    "call\\t%a0, %1\\n\\tadd\\t%%o7, (%l2-.-4), %%o7")
  
  (define_expand "prologue"
--- 9483,9489 ----
     (set (pc) (label_ref (match_operand 2 "" "")))]
    "TARGET_ARCH64
     && short_branch (INSN_UID (insn), INSN_UID (operands[2]))
!    && (USING_SJLJ_EXCEPTIONS || ! can_throw_internal (insn))"
    "call\\t%a0, %1\\n\\tadd\\t%%o7, (%l2-.-4), %%o7")
  
  (define_expand "prologue"


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