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]

Re: [PATCH] Make EH_RETURN_STACKADJ_RTX optional (fixes s390)


I think it was this patch that broke EH for mips-sgi-irix6.5, see:

    http://gcc.gnu.org/ml/gcc-testresults/2003-05/msg00722.html

As far as I can tell, the problem is with this hunk:

Ulrich Weigand <weigand@immd1.informatik.uni-erlangen.de> writes:
> *************** uw_init_context_1 (struct _Unwind_Contex
> *** 1202,1208 ****
>       abort ();
>   
>     /* Force the frame state to use the known cfa value.  */
> !   context->cfa = outer_cfa;
>     fs.cfa_how = CFA_REG_OFFSET;
>     fs.cfa_reg = __builtin_dwarf_sp_column ();
>     fs.cfa_offset = 0;
> --- 1206,1212 ----
>       abort ();
>   
>     /* Force the frame state to use the known cfa value.  */
> !   _Unwind_SetGRPtr (context, __builtin_dwarf_sp_column (), &outer_cfa);
>     fs.cfa_how = CFA_REG_OFFSET;
>     fs.cfa_reg = __builtin_dwarf_sp_column ();
>     fs.cfa_offset = 0;

since outer_cfa is a 'void *' pointer rather than an _Unwind_Word.

The patch below seems to fix the cases I've tried.  Running a full
bootstrap now.  But I'm not sure whether (_Unwind_Ptr) is the right
cast to use.  An alternative would be to change the type of outer_cfa
and update uw_init_context accordingly.

Richard


	* unwind-dw2.c (uw_init_context_1): Don't pass &outer_cfa directly
	to _Unwind_SetGRPtr().

Index: unwind-dw2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind-dw2.c,v
retrieving revision 1.31
diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.31 unwind-dw2.c
*** unwind-dw2.c	10 May 2003 22:58:59 -0000	1.31
--- unwind-dw2.c	12 May 2003 09:20:02 -0000
*************** uw_init_context_1 (struct _Unwind_Contex
*** 1198,1203 ****
--- 1198,1204 ----
  {
    void *ra = __builtin_extract_return_addr (__builtin_return_address (0));
    _Unwind_FrameState fs;
+   _Unwind_Word sp_slot;
  
    memset (context, 0, sizeof (struct _Unwind_Context));
    context->ra = ra;
*************** uw_init_context_1 (struct _Unwind_Contex
*** 1206,1212 ****
      abort ();
  
    /* Force the frame state to use the known cfa value.  */
!   _Unwind_SetGRPtr (context, __builtin_dwarf_sp_column (), &outer_cfa);
    fs.cfa_how = CFA_REG_OFFSET;
    fs.cfa_reg = __builtin_dwarf_sp_column ();
    fs.cfa_offset = 0;
--- 1207,1214 ----
      abort ();
  
    /* Force the frame state to use the known cfa value.  */
!   sp_slot = (_Unwind_Ptr) outer_cfa;
!   _Unwind_SetGRPtr (context, __builtin_dwarf_sp_column (), &sp_slot);
    fs.cfa_how = CFA_REG_OFFSET;
    fs.cfa_reg = __builtin_dwarf_sp_column ();
    fs.cfa_offset = 0;


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