[Patch] Fix stack alignment for calls without frame setup or destroy

Renato Golin renato.golin at linaro.org
Mon Apr 22 03:22:59 PDT 2013


Hi Andrew,

Sorry for the delay. I had a read on the code around it and it seems that
with your patch, the stack will always grow if there is a call and not a
frame pointer. I'm not sure how this correlates with functions without
stack setup, line __aeabi_read_tp, but it might bloat the stack for many
other unrelated functions.

However, I can see from the comments that adjusting the stack should be
done on any function call, and I don't know that part of the code well
enough, so if no one else has any objections, I'm ok with your patch.

cheers,
--renato


On 18 April 2013 23:48, Andrew Turner <andrew at fubar.geek.nz> wrote:

> On Thu, 18 Apr 2013 09:28:03 +0100
> Renato Golin <renato.golin at linaro.org> wrote:
>
> > On 18 April 2013 03:35, Andrew Turner <andrew at fubar.geek.nz> wrote:
> >
> > > The attached patch makes tells the calling function it needs to
> > > adjust it's stack when it contains a call opcode.
> > >
> >
> > Hi Andrew,
> >
> > Isn't that a bit too generic a fix for such a specific case?
>
> I don't think so. Clang should adjust the stack when a function calls
> another, this patch fixes the case where the function call doesn't have
> the frame setup or destroy opcodes around it. I'm not sure how common
> this is as I have only observed it with __aeabi_read_tp, and there may
> be other cases that have yet to been observed.
>
> Andrew
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130422/e8b55584/attachment.html>


More information about the llvm-commits mailing list