[LLVMbugs] [Bug 18919] New: Clang integrated assembler does not handle :vararg macro arguments

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Feb 20 19:28:13 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18919

            Bug ID: 18919
           Summary: Clang integrated assembler does not handle :vararg
                    macro arguments
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: simon.hosie at arm.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12095
  --> http://llvm.org/bugs/attachment.cgi?id=12095&action=edit
example assembly code (ARM).

I use an assembly macro like this:
.if cc
            \zzz
.endif
.endm

.set cc,1 /* normally something complicated */
...
    ifcc    sub         r12, r5, LSL #6
            bx          r12

This way I can stub out several instructions in a routine without needing to
cloud the code with lots of conditional assembly.  Typically I set cc to some
macro parameter to get different variants without excessive copy-paste.

Unfortunately:
 % clang --target=arm-linux-gnueabihf -integrated-as ifcc.S
ifcc.S:1:17: error: vararg is not a valid parameter qualifier for 'zzz' in
macro 'ifcc'
.macro ifcc zzz:vararg
                ^
ifcc.S:2:5: error: expected absolute expression
.if cc
    ^
ifcc.S:3:13: error: unexpected token at start of statement
            \zzz
            ^
ifcc.S:5:6: error: unexpected '.endm' in file, no current macro definition
.endm
     ^
ifcc.S:12:14: error: unexpected token in argument list
    ifcc sub r12, r5, LSL #6
             ^

While the GNU assembler sees no problems.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140221/990f417a/attachment.html>


More information about the llvm-bugs mailing list