[dmd-internals] [D-Programming-Language/dmd] 29eb97: more 64 bit ABI for structs

Walter Bright walter at digitalmars.com
Wed May 9 19:33:29 PDT 2012



On 5/9/2012 1:29 PM, Jonathan M Davis wrote:
> On Wednesday, May 09, 2012 13:21:04 GitHub wrote:
>> Branch: refs/heads/master
>> Home: https://github.com/D-Programming-Language/dmd
>> Commit: 29eb972a2f329276a72a19e722671ff26bfe8534
>>
>> https://github.com/D-Programming-Language/dmd/commit/29eb972a2f329276a72a19
>> e722671ff26bfe8534 Author: Walter Bright<walter at walterbright.com>
>> Date: 2012-05-09 (Wed, 09 May 2012)
>>
>> Changed paths:
>> M src/argtypes.c
>> M src/backend/cgelem.c
>> M src/backend/cod1.c
>> M src/class.c
>> M src/declaration.c
>> M src/e2ir.c
>> M src/mtype.h
>> M src/toir.c
>> M src/typinf.c
>>
>> Log Message:
>> -----------
>> more 64 bit ABI for structs
> It looks like the build is failing even worse than before now. The dmd and
> druntime tests are failing as well.

The failures I've traced back to the guts of std.datetime. I dread those, 
because trying to isolate down 50,000,000,000 lines of endless layers of types 
is several hours of work. The current one I've reduced to:

import core.stdc.stdio;

void main()
{
         SysTime st = Clock.currTime();
string s = st._timezone.name;
printf("_stdTime = x%llx _timezone = %*.s\n", st._stdTime, s.length, s.ptr);
         SysTimeToDosFileTime(st);
}

which gives an assert failure in SysTimeToDosFileTime() on 64 bit Linux. So far, 
I have been unable to determine if the corruption is in the value of st, or in 
SysTimeToDosFileTime(). I.e. I cannot figure out of st._stdTime or st._timezone 
is corrupt, or neither. (I made _stdTime and _timezone public to help out with 
this.)

I do know that the problem is caused somewhere where a struct is passed in a 
register and is expected to have been passed on the stack, or vice versa.

If you could help isolate it down to a test case that does not involve 
std.datetime, I would most appreciate it.


More information about the dmd-internals mailing list