[Issue 2385] New: spec says all structs are returned via hidden pointer on linux, but it uses registers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 2 03:22:01 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2385

           Summary: spec says all structs are returned via hidden pointer on
                    linux, but it uses registers
           Product: D
           Version: 1.034
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: tomas at famolsen.dk


the following test compiled with dmd 1.034 on linux should return via a hidden
pointer parameter, but is actually returned in registers:

struct S
{
    int x;
    int z;
    static S foo()
    {
        S s = {1,2};
        return s;
    }
}

becomes

_D4test1S3fooFZS4test1S:
                push    EBP
                mov     EBP,ESP
                sub     ESP,8
                mov     dword ptr -8[EBP],1
                mov     dword ptr -4[EBP],2
                mov     EDX,-4[EBP]
                mov     EAX,-8[EBP]
                leave
                ret


-- 



More information about the Digitalmars-d-bugs mailing list