http://llvm.org/bugs/show_bug.cgi?id=3788

           Summary: asm inline : support casting on input operand
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Hi :

$ cat /tmp/p.c 
int foo()
{
        int a;
        asm("nop"
                        :
                        : "m"((int)(a))
                        );
}

$ ./llvm/tools/clang/tools/ccc/ccc /tmp/p.c -c -o /tmp/p.o
/tmp/p.c:6:10: error: invalid lvalue in asm input for constraint 'm'
                        : "m"((int)(a))
                              ^~~~~~~~
1 diagnostic generated.


The casting should be the same thing than doing :

int foo()
{
        int a;
         int tmp = a;
        asm("nop"
                        :
                        : "m"(tmp)
                        );
}


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to