D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1252 - Inline assembler could support BasicType properties
Summary: Inline assembler could support BasicType properties
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 enhancement
Assignee: No Owner
URL:
Keywords: iasm, pull
: 1614 (view as issue list)
Depends on:
Blocks:
 
Reported: 2007-05-31 09:36 UTC by Matti Niemenmaa
Modified: 2020-03-21 03:56 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Matti Niemenmaa 2007-05-31 09:36:11 UTC
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 2 Matti Niemenmaa 2007-10-26 13:10:55 UTC
*** Bug 1614 has been marked as a duplicate of this bug. ***
Comment 3 Trass3r 2011-11-29 17:06:36 UTC
Using the .ptr property of an array doesn't work either.
Neither does &arr.
Comment 4 basile-z 2019-06-20 20:50:52 UTC
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 Dlang Bot 2019-06-20 21:36:32 UTC
@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 Dlang Bot 2019-07-05 01:00:54 UTC
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