<div dir="ltr"><div class="gmail_extra">On 25 March 2013 08:32, Stepan Dyatkovskiy <span dir="ltr"><<a href="mailto:stpworld@narod.ru" target="_blank">stpworld@narod.ru</a>></span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hello, please find patch in attachment for 15293 issue.<br>

I just added case when whole structure may be stored in GPR regs.<br></blockquote><div><br></div><div>Hi Stepan,<div><br></div><div>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.</div>
</div><div><br></div><div style>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.</div>
<div style><br></div><div style>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).</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

I also wonder: what was real purpose of assertion:<br>
"assert(size >= excess && "expected larger existing stack allocation");" ?</blockquote><div><br></div><div style>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.</div>
<div style><br></div><div style>cheers,</div><div style>--renato</div></div></div></div>