[Issue 11310] New: Alignment failure in test42.d
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Oct 20 22:44:01 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11310
Summary: Alignment failure in test42.d
Product: D
Version: D2
Platform: x86_64
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bugzilla at digitalmars.com
--- Comment #0 from Walter Bright <bugzilla at digitalmars.com> 2013-10-20 22:43:57 PDT ---
Here's the code that fails in test/runnable/test42.d:
-----------------------------
align(16) struct S41
{
int[4] a;
}
shared int x41;
shared S41 s41;
void test41()
{
printf("&x = %p\n", &x41);
printf("&s = %p\n", &s41);
assert((cast(int)&s41 & 0xF) == 0);
}
----------------------------
when compiled on Linux with:
-O -fPIC
Curiously, it prints:
&x = 0x7fef00
&s = 0x7fef10
which shows it is aligned correctly - so why does the assert fail?
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list