[Issue 2692] New: alignment of double on x86 linux is incorrect
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Feb 27 05:39:34 PST 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2692
Summary: alignment of double on x86 linux is incorrect
Product: D
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Keywords: wrong-code
Severity: major
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: tomas at famolsen.dk
See this testcase, DMD fails the second assertion, so it does not match the
companion C compiler (which is gcc on linux) as per spec.
The correct alignment of double is 4.
D CODE:
=======
void main()
{
Foo f = foo();
assert(f.i == 42);
assert(f.d == 2.5);
}
extern(C):
struct Foo
{
int i;
double d;
}
Foo foo();
C CODE:
=======
typedef struct
{
int i;
double d;
} S;
S foo(void)
{
S s;
s.i = 42;
s.d = 2.5;
return s;
}
--
More information about the Digitalmars-d-bugs
mailing list