www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10459] New: align(16) does not work on Win64 with seperate compilation

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: r.sagitario gmx.de


--- Comment #0 from Rainer Schuetze <r.sagitario 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: -------
Jun 23 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10459


Rainer Schuetze <r.sagitario gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, wrong-code


--- Comment #1 from Rainer Schuetze <r.sagitario gmx.de> 2013-06-23 23:38:50
PDT ---
https://github.com/D-Programming-Language/dmd/pull/2253

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 23 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10459



--- Comment #2 from github-bugzilla puremagic.com 2013-06-24 09:02:45 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/30701cefbb2489d024e5601063446b8561687181
Merge pull request #2253 from rainers/fix_10459

 fix Issue 10459 - align(16) does not work on Win64 with seperate compilation

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