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


Denis <verylonglogin....@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |verylonglogin....@gmail.com


--- Comment #1 from Denis <verylonglogin....@gmail.com> 2012-03-02 17:37:11 MSK 
---
The first one is definetly a bug with const/immutable local variables:
---
void f() {
    const size_t a = 1; // Error: Integer constant expression expected instead
of a = 1u
    version (D_InlineAsm_X86_64)
        asm { mov RAX, a; }
    else version (D_InlineAsm_X86)
        asm { mov EAX, a; }
    else
        static assert(1);
}
---

The second one looks like expected behaviour because with current inline
assembler for non-stack varable `someVar` instruction `mov EAX, someVar;` is
equal to `mov EAX, [someVar];` and `mov EAX, [n];` where `n` is a displacement
of `someVar` from some initial addres which depends on `someVar` type (global,
shared, or TLS).
Inline assembler behaves in this way but I've never seen any documentation and
reasons *why* does it behave this way because it's really unobvious.

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

Reply via email to