[LLVMbugs] [Bug 15765] New: inline assembly and =g constraint on output argument

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 17 02:19:55 PDT 2013


            Bug ID: 15765
           Summary: inline assembly and =g constraint on output argument
           Product: new-bugs
           Version: 3.2
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: bruce.mitchener at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

In emscripten, we support having JS as "inline assembly" (it makes perfect
sense in context).

With a very simple program:

    double get() {
      double ret = 0;
      __asm __volatile__("12/3.3":"=r"(ret));
      return ret;

    int main() {
      return (int)get();

And compiling it:

    /usr/local/bin/clang -target i386-pc-linux-gnu -emit-llvm -S -o m-r.ll

the inline asm compiles to:

    %0 = call double asm sideeffect "12/3.3",
"=r,~{dirflag},~{fpsr},~{flags}"() nounwind, !srcloc !0

However, changing it to a =g constraint instead of =r results in this:

    call void asm sideeffect "12/3.3",
"=*imr,~{dirflag},~{fpsr},~{flags}"(double* %ret) nounwind, !srcloc !0

This shows that it isn't picking up the value into ret.

Is =g permissible here or must I use =r?

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130417/18f6095d/attachment.html>

More information about the llvm-bugs mailing list