[Issue 17900] FreeBSD 10.3 runnable/cpp_abi_tests.d(94): Assertion failure (test suite)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 18 07:05:06 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=17900

--- Comment #3 from Walter Bright <bugzilla at digitalmars.com> ---
The problem turns out to be the C++ compiler returns:

    struct S { float a = 1; }

in ST0:

    _Z15passthrough_ptrP1S:
        mov    EAX,4[ESP]
    fld    float ptr [EAX]
    ret

while DMD expects it to be returned in EAX:

_Z15passthrough_ptrP1S:
        mov    EAX,4[ESP]
        fld    float ptr [EAX]
        ret
        push    EBP
        mov    EBP,ESP
        sub    ESP,018h
        mov    -010h[EBP],ESI
        lea    ECX,-4[EBP]
        mov    -0Ch[EBP],EDI
        mov    -4[EBP],EAX
        mov    -018h[EBP],ECX
        call      _Z15passthrough_ptrP1S at PC32
        lea    ESI,-8[EBP]
        lea    EDI,-4[EBP]
        mov    -8[EBP],EAX   <== return value
        mov    ECX,4
        xor    EAX,EAX
        rep
        cmpsb
        je    L41
        mov    dword ptr -014h[EBP],0Fh
        mov    dword ptr -018h[EBP],offset FLAT:_TMP1[038h]@SYM32
        call      _d_assertp at PC32
L41:        mov    ESI,-010h[EBP]
        mov    EDI,-0Ch[EBP]
        mov    ESP,EBP
        pop    EBP
        ret

--


More information about the Digitalmars-d-bugs mailing list