Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

x86 integrated assembler: & separator not functional in .altmacro mode in some cases #37974

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR39000
Status NEW
Importance P enhancement
Reported by emaste@freebsd.org
Reported on 2018-09-19 09:06:20 -0700
Last modified on 2020-11-04 12:08:37 -0800
Version 6.0
Hardware PC FreeBSD
CC cem@FreeBSD.org, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also PR33405
Found while trying to build the FreeBSD base system entirely with the
integrated assembler.

"In the alternative macro syntax mode the ampersand character (‘&’) can be used
as a separator."

Consider the following snippet:

-------------------------
.altmacro

v_0_0 = 255
.macro w v1,v2
_c_ = v_\v1&_\v2
.word _c_
.endm

w 0 0
-------------------------

GNU as and gcc assemble this by evaluating _c_ = v_0_0, producing .word 255.

Clang IAS produces:
<instantiation>:1:10: error: expression could not be evaluated
_c_ = v_0&_0
         ^
Quuxplusone commented 3 years ago

Still cannot be assembled with Clang IAS and can with GCC and GNU as, but we have worked around the issue in the base system.