Bug 1252 – Inline assembler could support BasicType properties

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2007-05-31T09:36:11Z
Last change time
2020-03-21T03:56:31Z
Keywords
iasm, pull
Assigned to
No Owner
Creator
Matti Niemenmaa

Comments

Comment #0 by matti.niemenmaa+dbugzilla — 2007-05-31T09:36:11Z
Probably related to Bug 1173. void main() { int x; asm { mov x, x.max; } } The above code compiles. However, if you replace "x.max" with "int.max", DMD complains about "ptr expected". Replace it with "typeof(x).max" or add brackets around the expression and DMD complains about "nops expected". This can be worked around by using a temporary or constant.
Comment #1 by thomas-dloop — 2007-08-25T16:41:54Z
Comment #2 by matti.niemenmaa+dbugzilla — 2007-10-26T13:10:55Z
*** Bug 1614 has been marked as a duplicate of this bug. ***
Comment #3 by hoganmeier — 2011-11-29T17:06:36Z
Using the .ptr property of an array doesn't work either. Neither does &arr.
Comment #4 by b2.temp — 2019-06-20T20:50:52Z
Currently it's not specified but can be supported since asm operands with dot exp must be evaluable by CTFE to a const. Changing importance from reject-valid to enhancement.
Comment #5 by dlang-bot — 2019-06-20T21:36:32Z
@Basile-z created dlang/dmd pull request #10069 "fix issue 1252 - Inline assembler could support BasicType properties" fixing this issue: - fix issue 1252 - Inline assembler could support BasicType properties https://github.com/dlang/dmd/pull/10069
Comment #6 by dlang-bot — 2019-07-05T01:00:54Z
dlang/dmd pull request #10069 "fix issue 1252 - Inline assembler could support BasicType properties" was merged into master: - 997492ea7eacd22777d0e689baf37f6e82810ffa by Basile Burg: fix issue 1252 - Inline assembler could support BasicType properties https://github.com/dlang/dmd/pull/10069