[LLVMbugs] [Bug 10352] New: inline asm can't tie bool to "q" constraint
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Jul 13 17:59:30 PDT 2011
http://llvm.org/bugs/show_bug.cgi?id=10352
Summary: inline asm can't tie bool to "q" constraint
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: Backend: X86
AssignedTo: unassignedbugs at nondot.org
ReportedBy: nlewycky at google.com
CC: llvmbugs at cs.uiuc.edu, echristo at gmail.com
Consider this code:
template <typename T>
inline void test(T desired) {
__asm__ __volatile__("foo %0" : : "q" (desired));
}
void helper() {
bool v; // char, short, float, double, unsigned long long all work
test(v);
}
Note that the failure about "foo" not being a valid mnemonic is not a problem.
The problem is:
$ clang z.cc
fatal error: error in backend: Couldn't allocate input reg for constraint 'q'!
GCC thinks this is fine:
$ gcc z.cc
z.cc: Assembler messages:
z.cc:3: Error: no such instruction: `foo %al'
--
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