<p>On Mar 4, 2013 3:27 PM, "Manu" <<a href="mailto:turkeyman@gmail.com">turkeyman@gmail.com</a>> wrote:<br>
><br>
> I'm doing a lot of experiments with GDC, and I'm noticing that leaf functions are still generating a stack frame and doing pointless work...<br>
><br>
> int leaf() pure nothrow<br>
> {<br>
>   return 0;<br>
> }<br>
><br>
> compile with -frelease -finline -O3, etc<br>
><br>
> I expect 2 opcodes, load immediate and return, but I get a whole pointless function including memory access O_O<br>
><br>
> Any ideas? Is this normal?</p>
<p>I'd expect so.  Leaf functions in C require explicit attributes to mark them.  Now that we've integrated UDA attributes into gcc attributes, we need to start building on what is needed to be implemented.   :)</p>

<p>import gcc.attributes; <br>
@attribute ("leaf") int leaf; <br></p>
<p>Regards<br>
-- <br>
Iain Buclaw</p>
<p>*(p < e ? p++ : p) = (c & 0x0f) + '0';</p>