D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20593 - [GCC ASM] Parser syntax for asm operands differs from GCC
Summary: [GCC ASM] Parser syntax for asm operands differs from GCC
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: Iain Buclaw
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-02-22 10:55 UTC by Iain Buclaw
Modified: 2020-03-14 17:48 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Iain Buclaw 2020-02-22 10:55:56 UTC
This is permitted in D.

    asm { "cpuid" : "=a" a; }

But the documented syntax in gcc says that the expression/variable should be around parentheses (https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#InputOperands)


The old (incorrect) syntax should be deprecated in favour of:

    asm { "cpuid" : "=a" (a); }
Comment 1 Dlang Bot 2020-02-22 21:23:09 UTC
@ibuclaw created dlang/dmd pull request #10820 "fix Issue 20593 - Parser syntax for asm operands differs from GCC" fixing this issue:

- fix Issue 20593 - Parser syntax for asm operands differs from GCC

https://github.com/dlang/dmd/pull/10820
Comment 2 Dlang Bot 2020-03-10 04:10:08 UTC
dlang/dmd pull request #10820 "fix Issue 20593 - Parser syntax for asm operands differs from GCC" was merged into master:

- 1ca04a8f6c976793804c536bca8a3c15486d5dff by Iain Buclaw:
  fix Issue 20593 - Parser syntax for asm operands differs from GCC

https://github.com/dlang/dmd/pull/10820
Comment 3 Dlang Bot 2020-03-14 17:48:29 UTC
dlang/dmd pull request #10916 "[dmd-cxx] Check in iasmgcc.c implementation" was merged into dmd-cxx:

- 73ad46093e2dbcfa922120553ee431449c88eb00 by Iain Buclaw:
  fix Issue 20593 - Parser syntax for asm operands differs from GCC

https://github.com/dlang/dmd/pull/10916