[LLVMbugs] [Bug 2627] New: clang doesn't understand "q"/"Q" constraint for __asm

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Aug 3 01:18:40 PDT 2008


           Summary: clang doesn't understand "q"/"Q" constraint for __asm
           Product: clang
           Version: unspecified
          Platform: Other
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: parser
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: cperciva at freebsd.org
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=1884)
 --> (http://llvm.org/bugs/attachment.cgi?id=1884)
builds with gcc, errors out with clang

FreeBSD's machine/endian.h on AMD64 contains the following definition:

#define __byte_swap_word_var(x) \
__extension__ ({ register __uint16_t __X = (x); \
   __asm ("xchgb %h0, %b0" : "+Q" (__X)); \
   __X; })

On i386, the definition is the same except with "+Q" replaced by "+q".

In both cases, clang exits with an error message complaining about the "+Q" or
"+q":  "error: invalid output constraint in asm"

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.

More information about the llvm-bugs mailing list