[llvm-dev] Issue compiling x86 assembly code with clang

ROHIT KUMAR via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 20 02:24:07 PDT 2017


Hey guys,

I am trying to compile *x86 assembly code* with clang, which gets compiled
successfully with -O1 flag but fails with -O0 flag with below-mentioned
error:

inline assembly requires more registers than available
                  "pushl       %%ebx           \n\t"


*The code snippet is something like:*

__asm__ (
           "pushl       %%ebx           \n\t"
             ... // more assembly code

          : // No Input

          : // 6 output fields

          : "%eax", "%ecx", "%esi", "%edi", "memory" // all these clobbers
 );


Does anyone have a clue on how should I debug this issue?

Note: This assembly code works fine with gcc.

Thanks.
Rohit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170720/e38bdff5/attachment-0001.html>


More information about the llvm-dev mailing list