<html><head><base href="x-msg://217/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Looks like a problem with llvmc. Your example works fine with clang.<div><br></div><div><div>~/tmp $ cat foo.c</div><div>void foo() {</div><div> __asm__ volatile ("push {r4}\n\t");</div><div>}</div><div>gilgamesh: ~/tmp $ clang -target arm-linux-eabi -S -Os foo.c -o -</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.syntax unified</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.eabi_attribute 20, 1</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.eabi_attribute 21, 1</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.eabi_attribute 23, 3</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.eabi_attribute 24, 1</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.eabi_attribute 25, 1</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.file<span class="Apple-tab-span" style="white-space:pre"> </span>"foo.c"</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.text</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.globl<span class="Apple-tab-span" style="white-space:pre"> </span>foo</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.align<span class="Apple-tab-span" style="white-space:pre"> </span>2</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.type<span class="Apple-tab-span" style="white-space:pre"> </span>foo,%function</div><div>foo:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>@APP</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>push {r4}</div><div><span class="Apple-tab-span" style="white-space:pre"> </span></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>@NO_APP</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>bx<span class="Apple-tab-span" style="white-space:pre"> </span>lr</div><div>.Ltmp0:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.size<span class="Apple-tab-span" style="white-space:pre"> </span>foo, .Ltmp0-foo</div><div><br></div><div><div>On Jul 11, 2012, at 1:44 AM, Moshe Kravchik wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; "><div dir="ltr">Hi,<div><br></div><div>I encountered an issue with inline assembly in my c files compiled with llvmc.</div><div><br></div><div>When I have a push instruction in the inline assembly like:</div><div><br></div><div><span style="font-family: 'Times New Roman'; font-size: 12pt; background-color: rgb(255, 255, 255); "> </span><span style="font-size: 10pt; ">__asm__ volatile (</span></div><div> "push {r4}\n\t"</div><div> );</div><div><br></div><div>the compiler will drop the curly braces and leave it in the generated assembly file as:</div><div><div> push r4</div></div><div><br></div><div>And this is non-conformant with the ARM assembly<span class="Apple-converted-space"> </span><a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204j/Babefbce.html">synta! x</a><span class="Apple-converted-space"> </span>for push and pop.</div><div><br></div><div>Is there any ways to resolve or overcome that? I need to keep the assembly inline, and not move it to the .s files.</div><div><br></div><div>I used the following llvmc:</div><div><div> llvm version 2.9</div><div> Optimized build.</div><div> Built Sep 8 2011 (11:43:28).</div><div> Host: i386-pc-linux-gnu</div><div> Host CPU: core2</div></div><div><br></div><div>Using the following flags:</div><div>-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 </div><div><br></div><div>Thanks a lot,</div><div>Moshe</div></div>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a><span class="Apple-converted-space"> </span> <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></blockquote></div><br></div></body></html>