www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16045] New: Unable to loading global variables in inline

https://issues.dlang.org/show_bug.cgi?id=16045

          Issue ID: 16045
           Summary: Unable to loading global variables in inline assembly
                    with -fPIC
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: aliloko gmail.com

Consider the following source file `asm_pic.d`:

    align(16) static immutable short[8] A = [ 1, 1, 1, 1, 3, 3, 3, 3 ];

    void main()
    {
        asm
        {                 
            pmullw XMM0, A;
        }
    }

LDC 1.0.0-b1 thinks it's compatible with PIC code.

```bash


```

DMD disallows to load the constant in PIC code.




asm_pic.d(7): Error: cannot directly load global variable 'A' with PIC code

--
May 19 2016