This is the mail archive of the gcc@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: GCC 3.3 Prelease broken on s390


On Wed, May 07, 2003 at 02:24:34AM +0200, Ulrich Weigand wrote:
> Interestingly, mainline works fine without any patch.

That doesn't seem right at all.

> This is because mainline contains this if:
>     if (!_Unwind_GetGRPtr (&orig_context, __builtin_dwarf_sp_column ()))
> 
> and since on s390 there is always a CFA record to restore
> the stack pointer from, that new code to fiddle with the
> stack pointer is never even entered ...

Yes, but then later in uw_install_context we should see the
saved stack pointer and install that instead of the CFA like
you wanted.

(Why in the world do you save the stack frame in each frame?
Just history for descriptionless unwinding?)

> In any case, shouldn't these two:
> > @@ -1096,7 +1101,7 @@ uw_update_context_1 (struct _Unwind_Cont
> >       the value over from one frame to another doesn't make sense.  */
> >    if (!_Unwind_GetGRPtr (&orig_context, __builtin_dwarf_sp_column ()))
> >      {
> > -      tmp_sp = (_Unwind_Ptr) context->cfa;
> > +      tmp_sp = (_Unwind_Ptr) context->cfa + RUNTIME_SP_CFA_OFFSET;
> >        _Unwind_SetGRPtr (&orig_context, __builtin_dwarf_sp_column (), &tmp_sp);
> >      }
> >    _Unwind_SetGRPtr (context, __builtin_dwarf_sp_column (), NULL);
> > @@ -1267,6 +1272,7 @@ uw_install_context_1 (struct _Unwind_Con
> >    if (_Unwind_GetGRPtr (target, __builtin_dwarf_sp_column ()))
> >      target_cfa = (void *)(_Unwind_Ptr)
> >        _Unwind_GetGR (target, __builtin_dwarf_sp_column ());
> > +      + RUNTIME_SP_CFA_OFFSET;
> >    else
> >      target_cfa = target->cfa;
> 
> have different signs for the offset?  The one adds to cfa in order
> to get sp, the other adds to sp to get cfa ...  Which direction
> is the macro supposed to represent?

Um... right.  SP->CFA means the second one is right, the first one
is wrong, and the definition itself has the wrong sign.


r~


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