[Issue 16098] align(32) not respected for stack variables
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Wed Jan 30 23:02:48 UTC 2019
    
    
  
https://issues.dlang.org/show_bug.cgi?id=16098
--- Comment #3 from Vladimir Panteleev <dlang-bugzilla at thecybershadow.net> ---
Well, this is annoying.
Broken code:
    align(16) uint[128] state;
    asm { fxsave state; }
"Fixed" code:
    uint[128 + 4] buf;
    auto state = cast(uint*)((cast(size_t)buf.ptr + 0xF) & ~size_t(0xF));
    version (X86_64)
        asm { mov RAX, state; fxsave 0[RAX]; }
    else
        asm { mov EAX, state; fxsave 0[EAX]; }
--
    
    
More information about the Digitalmars-d-bugs
mailing list