[LLVMdev] A problem with inline assembly in llvmc for ARM

Moshe Kravchik mkravchik at hotmail.com
Wed Jul 11 01:44:05 PDT 2012


Hi,
I encountered an issue with inline assembly in my c files compiled with llvmc.
When I have a push instruction in the inline assembly like:
 __asm__ volatile (                                "push   {r4}\n\t"                          );
the compiler will drop the curly braces and leave it in the generated assembly file as:        push    r4
And this is non-conformant with the ARM assembly syntax for push and pop.
Is there any ways to resolve or overcome that? I need to keep the assembly inline, and not move it to the .s files.
I used the following llvmc:  llvm version 2.9  Optimized build.  Built Sep  8 2011 (11:43:28).  Host: i386-pc-linux-gnu  Host CPU: core2
Using the following flags:-Wllc,="-mtriple=arm-linux-eabi" -fmessage-length=0  -std=c99 -Wno-trigraphs -O3 -fpic -Wreturn-type -Wunused-variable -fvisibility=hidden -D__ARM_EABI__ -DANDROID -isysroot/usr/local/android/android-ndk-r6b/platforms/android-8/arch-arm 
Thanks a lot,Moshe 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120711/848cddcc/attachment.html>


More information about the llvm-dev mailing list