[Issue 5922] immutable and static variables usage in asm{}

2020-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5922

--- Comment #3 from Walter Bright  ---
In reply to bearophile_hugs from comment #0)
> --
> 
> D2 code, static (thread-local) variables can't be used in ASM:
> 
> [...]

Moved to https://issues.dlang.org/show_bug.cgi?id=21186 as it is a different
bug.

--


[Issue 5922] immutable and static variables usage in asm{}

2020-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5922

Walter Bright  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=21186

--


[Issue 5922] immutable and static variables usage in asm{}

2017-07-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5922

Vladimir Panteleev  changed:

   What|Removed |Added

   Hardware|x86 |All
 OS|Windows |All

--


[Issue 5922] immutable and static variables usage in asm{}

2013-01-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5922


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 CC||yebbl...@gmail.com


--- Comment #2 from yebblies yebbl...@gmail.com 2013-01-17 00:04:57 EST ---
For some reason x's initializer is x = 10 instead of just 10.  Probably a
side effect of some hack.

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


[Issue 5922] immutable and static variables usage in asm{}

2012-03-02 Thread d-bugmail
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: ---