[PATCH][SH] CFI directives patch
Thomas Schwinge
thomas@codesourcery.com
Wed May 23 12:06:00 GMT 2012
Hi!
Thanks for your explanations.
On Fri, 11 May 2012 17:15:52 +0800, Chung-Lin Tang <chunglin.tang@gmail.com> wrote:
> >> diff --git a/sysdeps/unix/sh/sysdep.S b/sysdeps/unix/sh/sysdep.S
> >> index e816575..939eb9a 100644
> >> --- a/sysdeps/unix/sh/sysdep.S
> >> +++ b/sysdeps/unix/sh/sysdep.S
> >> @@ -41,13 +41,15 @@ skip:
> >> sts.l pr, @-r15
> >> cfi_adjust_cfa_offset (4)
> >> cfi_rel_offset (pr, 0)
> >> + cfi_adjust_cfa_offset (4)
> >> jsr @r1
> >> mov.l r0, @-r15
> >> - cfi_adjust_cfa_offset (4)
> >
> > Hmm?
>
> I think this was to fix the case of a frame-insn in a call delay slot
> kind of problem. Imagine unwinding from inside the @r1 function (here
> it's errno); it will get the stack position one word off.
Hmm, that doesn't match my understanding. The CFI of the caller is of no
interested to the callee: the CFI is purely a local thing for the
instructions with addresses between the .cfi_startproc and .cfi_endproc
directives (to compute the beginning of the frame based on SP's value in
this case). The callee will have its own CFI to compute the frame
address based on the value of the SP (which will have been decremented
before @r1 is executed) and its own CFI between .cfi_startproc and
.cfi_endproc.
> But reviewing it, I think it's better to move the frame-insn (and CFI)
> above the call and just fill nop.
With my reasoning above (and please someone tell me if I'm wrong), there
is no need to do that (and avoid the slight code pessimization).
I'll next look at your updated patch -- the very most of it should be
ready to commit.
Grüße,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120523/115259f1/attachment.sig>
More information about the Libc-alpha
mailing list