[cfe-users] Integrated Assembler, JNZ and "unknown token in expression"

Jeffrey Walton via cfe-users cfe-users at lists.llvm.org
Thu Dec 24 20:38:38 PST 2015


Hi Everyone,

I'm catching a compile error with some inline assembly under Clang 3.4
provided by Ubuntu 14.04 LTS. The compile error is shown below (with
macro expansion), but the essence is "JNZ 1b;" is producing "error:
unknown token in expression".

Any ideas how I can work around the issue?

Thanks in advance.

**********

clang++ -DNDEBUG -g2 -O2 -fPIC -march=native -pipe -c gcm.cpp
gcm.cpp:812:3: error: unknown token in expression
                ASJ(    jnz,    1, ...
                ^
./cpu.h:272:23: note: expanded from macro 'ASJ'
        #define ASJ(x, y, z) GNU_ASJ(x, y, z)
                             ^
./cpu.h:266:27: note: expanded from macro 'GNU_ASJ'
        #define GNU_ASJ(x, y, z) #x " " #y #z ";" NEW_LINE
                                 ^
<scratch space>:297:2: note: expanded from here
"jnz"
 ^
<inline asm>:69:7: note: instantiated into assembly here
jnz 1b;
      ^

**********

This particular code block uses Intel syntax, but the problem is not
encountered until the JNZ is encountered.

This may be related: "LLVM Bug 24232 - [X86] Inline assembly operands
don't work with .intel_syntax",
http://llvm.org/bugs/show_bug.cgi?id=24232 . But I can only say "may"
because hundreds of other lines of Intel syntax are fine.



More information about the cfe-users mailing list