Issue compiling x86 assembly code with clang

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Issue compiling x86 assembly code with clang

Sumner, Brian via cfe-dev
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

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue compiling x86 assembly code with clang

Sumner, Brian via cfe-dev
(most lists to bcc)

Hi Rohit,

On Thu, Jul 20, 2017 at 11:24 AM, ROHIT KUMAR via cfe-dev
<[hidden email]> wrote:

> 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.

Please don't post to all mailing lists at once like this.

In this case, I think filing a bug at https://bugs.llvm.org/ would be the best.

Thanks,
Hans
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Loading...