Fix PR15293: ARM codegen ice - expected larger existing stack allocation

Renato Golin renato.golin at linaro.org
Mon Mar 25 02:57:24 PDT 2013


On 25 March 2013 08:32, Stepan Dyatkovskiy <stpworld at narod.ru> wrote:

> Hello, please find patch in attachment for 15293 issue.
> I just added case when whole structure may be stored in GPR regs.
>

Hi Stepan,

The matter is slightly more complex than that. Front-ends lower structure
byval calls casting to arrays because there was no support for structure
byval in the ARM back-end. I haven't followed the story for a long time, it
might be supported by now, but I wouldn't trust on it without reassurance.

Implementing small structures into registers looks that simple, but that
will get a lot more complex when structures are slightly bigger, or more
complex, or of a variable size, and lowering that in the front end
(especially when dealing with C++) is not trivial.

I'd say that, if you want to implement structure byval, let's do it full,
or make your front-end cast to an array (like we did back then).



> I also wonder: what was real purpose of assertion:
> "assert(size >= excess && "expected larger existing stack allocation");" ?


I think that's a safeguard because structure byval is not implemented, so
that it gets passed in the stack, but I could be wrong.

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130325/415d91b1/attachment.html>


More information about the llvm-commits mailing list