[Issue 10459] New: align(16) does not work on Win64 with seperate compilation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 23 23:31:08 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10459

           Summary: align(16) does not work on Win64 with seperate
                    compilation
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: r.sagitario at gmx.de


--- Comment #0 from Rainer Schuetze <r.sagitario at gmx.de> 2013-06-23 23:31:07 PDT ---
Compile these two files separately:

////////////////////////
module test;
import core.stdc.stdio;
import test2;

int x;
align(16) int y;

__gshared int ga;
align(16) __gshared int gb;


void main()
{
    int[] arr = (&y)[0..1];
    printf("&x = %p\n", &x);
    printf("&y = %p\n", &y);
    printf("&ga = %p\n", &ga);
    printf("&gb = %p\n", &gb);

    printf("&x2 = %p\n", &x2);
    printf("&y2 = %p\n", &y2);
    printf("&ga2 = %p\n", &ga2);
    printf("&gb2 = %p\n", &gb2);
}
////////////////////////
module test2;

int x2;
align(16) int y2;

__gshared int ga2;
align(16) __gshared int gb2;
////////////////////////

dmd -c -m64 test.d
dmd -c -m64 test2.d
dmd -m64 test.obj test2.obj
test

prints

&x = 00000000001D2C40
&y = 00000000001D2C50
&ga = 00000001400350E0
&gb = 00000001400350F0
&x2 = 00000000001D2C60
&y2 = 00000000001D2C70
&ga2 = 00000001400350F8
&gb2 = 0000000140035108

showing that gb2 is not aligned to 16 as requested.

-- 
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