June 27, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5570



--- Comment #29 from Iain Buclaw <ibuclaw@ubuntu.com> 2012-06-27 10:02:08 PDT ---
(In reply to comment #27)
> (In reply to comment #26)
> > (In reply to comment #25)
> > > Sigh – seems like I was not exactly right about how GDC and LDC are handling arrays. Instead of treating them like the equivalent struct, they are treated as if length and pointer were two separate arguments […]
> > They are created as a two field struct in GDC.
> 
> Oh well, apparently GDC handles dynamic arrays like structs in most cases, but as size_t/void* pairs for variadic arguments, ABI-wise – I discovered this behavior looking at the generated assembly while working on the LDC vararg ABI, and didn't expect formal arguments to be treated differently. Maybe the behavior should be unified?
> 

Yes, that is correct for dynamic arrays. :~)

It does it on a condition that's pre-set as 'true' and can't be altered by the user.  Of course, if all two field types in D (D arrays; delegates) should *always* be passed in the same way as two field struct should be, then I can turn it off (and add a switch to toggle it), or remove this code.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 30, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5570



--- Comment #30 from Don <clugdbug@yahoo.com.au> 2012-07-30 02:01:12 PDT ---
Progress at DMD1.075/2.060 beta2:
This now works for structs which contain integral types only, or which contain
floating point types only. It doesn't work if you have an int member and a
float member.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 13, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5570


Adrian Matoga <epi@atari8.info> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |epi@atari8.info


--- Comment #31 from Adrian Matoga <epi@atari8.info> 2012-10-12 23:32:04 PDT ---
*** Issue 8810 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 22, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5570


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich@gmail.com


--- Comment #32 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-10-22 12:47:53 PDT ---
(In reply to comment #30)
> Progress at DMD1.075/2.060 beta2:
> This now works for structs which contain integral types only, or which contain
> floating point types only. It doesn't work if you have an int member and a
> float member.

http://dpaste.dzfl.pl/f1ac00d2

Output is Test(5, 6, 5, 6) instead of Test(5, 6, 7, 8). It works OK if the
function is extern(C).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 30, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5570



--- Comment #33 from David Nadlinger <code@klickverbot.at> 2012-12-29 18:04:07 PST ---
I added issue 9239 as a blocker of this, as it also concerns the System V x86-64 ABI.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 06, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5570


Marco Leise <Marco.Leise@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Marco.Leise@gmx.de


--- Comment #34 from Marco Leise <Marco.Leise@gmx.de> 2013-02-06 03:59:36 PST ---
Is this why my XCB calls on Linux fail? I already accused XCB people of writing incorrect tutorials until I realized that the exact same code does work in C. After probably two hours of trial and error to fix my code and reading articles on the web the word x86-64 showed up there and I had a dim memory of something not working in DMD 64-bit and C structs. So I tried GDC again, which I stopped because it produced another error somewhere else. There it works. The struct I try to get returned by a C library function looks like this:

struct { void*, int, int }

Most notably the int fields in my case should be 116 and 1, but are 0 and 0, while the pointer does have some value (not sure if the correct one as they change from executable to executable).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 23, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5570



--- Comment #35 from github-bugzilla@puremagic.com 2013-02-23 15:10:03 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/8fbb9279d51605d74824789d4954477b714bef52 64 bit ABI struct returns - Issue 5570 again

https://github.com/D-Programming-Language/dmd/commit/a39da1070a5dbc84ecc1cd509ea85634ffdd7081 Merge pull request #1630 from Govelius/8fbb9279d51605d74824789d4954477b714bef52

64 bit ABI 16byte struct returns - Issue 5570 again

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 25, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5570



--- Comment #36 from github-bugzilla@puremagic.com 2013-02-25 10:38:47 PST ---
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/b2da13f39701796a6934e200f7c024305bd0c9e8 Merge pull request #1630 from Govelius/8fbb9279d51605d74824789d4954477b714bef52

64 bit ABI 16byte struct returns - Issue 5570 again

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 06, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5570


Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code@dawg.eu


--- Comment #37 from Martin Nowak <code@dawg.eu> 2013-06-06 13:18:21 PDT ---
Is this finally finished?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 06, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5570



--- Comment #38 from David Nadlinger <code@klickverbot.at> 2013-06-06 13:20:26 PDT ---
I don't think the three byte struct issue (see linked bug) has been fixed yet, but I haven't checked in a while.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------