D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9586 - Win64 5/6/7 struct returns
Summary: Win64 5/6/7 struct returns
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Windows
: P2 major
Assignee: Walter Bright
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2013-02-25 09:22 UTC by Shahid
Modified: 2015-06-09 05:11 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Shahid 2013-02-25 09:22:24 UTC
import std.stdio;

struct sss { short a,b,c; }

sss ret_sss(){
	return sss(1,2,3);
}

void main() {
	writeln( ret_sss() );
}

---
sometimes prints "sss(1,2,1)" 
sometimes prints "sss(1,2,0)"

I believe the problem was introduced in commit 5a10d078

backend/cgelem.c: elstruct() case 5,6,7

https://github.com/D-Programming-Language/dmd/commit/5a10d078687f4b87f4c2d1f2c76af4d560819c91

Note: test/runnable/testabi.d has a test case for this, currently disabled, please enable it once fixed.