<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"></head><body style="font-family:Arial;font-size:14px"><p>I'm having issues compiling crypto++'s inline assembly with recent builds of clang (from my experiments 5.0.0 onwards). The code in question is the 32-bit version of <a href="https://github.com/weidai11/cryptopp/blob/master/sha.cpp#L1005" target="_blank">https://github.com/weidai11/cryptopp/blob/master/sha.cpp#L1005</a> which is failing on line 1005 with the error "error: invalid operand for instruction".<br>
<br>
I've bolied this code down to:<br>
<br>
void test()<br>
{<br>
    __asm__ __volatile__<br>
    (<br>
    ".intel_syntax;\n"<br>
    "0:\n"<br>
    "jnz 0b;\n"<br>
    );<br>
}<br>
<br>
This compiles with GCC and clang 4.0.1 but fails with 5.0.0 and 6.0.0 https://godbolt.org/g/ikFCrk<br>
Changing to AT&T syntax makes it build. Changing the jump to "0f" compiles (but obviously generates a jump to nowhere).<br>
<br>
Any ideas how to solve this issue or is it a bug in clang's intel syntax support?</p></body></html>