<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 12 February 2013 17:45, Johannes Pfau <span dir="ltr"><<a href="mailto:nospam@example.com" target="_blank">nospam@example.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've started debugging the unit test failures in std.datetime:<br>
<br>
We have this Date struct:<br>
-----<br>
struct Date<br>
{<br>
    this(int a){}<br>
    short _year  = 2;<br>
    ubyte _month = 1;<br>
    ubyte _day   = 1;<br>
}<br>
-----<br>
<br>
It's passed to D runtime variadic functions. It's 4 bytes in total so<br>
GCC passes this struct in registers on x86_64 and it's therefore saved<br>
in reg_save_area.<br>
<br>
But our va_arg implementation using TypeInfo calls TypeInfo.argTypes()<br>
to check if the type can be passed in parameters. This check returns<br>
false as it depends on the dmd check sym->isPOD. Therefore our va_arg<br>
tries to load the Date instance from the overflow_arg / stack save area<br>
instead of the register save area.<br>
<br>
What would be the correct way to tell the gcc backend not to pass !isPOD<br>
structs in registers? Using TREE_ADDRESSABLE?<br>
<br clear="all"></blockquote></div><br></div><div class="gmail_extra">TREE_ADDRESSABLE should be sufficient.  I can't think any reason off the top of my head why not.<br></div><div class="gmail_extra"><br>-- <br>Iain Buclaw<br>
<br>*(p < e ? p++ : p) = (c & 0x0f) + '0';
</div></div>