[LLVMbugs] [Bug 9280] New: Provide better diagnostics for invalid inline asm constraints.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Feb 21 10:23:13 PST 2011


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

           Summary: Provide better diagnostics for invalid inline asm
                    constraints.
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: stoklund at 2pi.dk
                CC: llvmbugs at cs.uiuc.edu


PR9252 has this inline assembly:

void f(unsigned x) {
    asm volatile ("hello" : "+a"(x) : "a"(x));
}

GCC provides this diagnostic:

$ gcc small.c
small.c: In function ‘f’:
small.c:2: error: can't find a register in class ‘AREG’ while reloading ‘asm’
small.c:2: error: ‘asm’ operand has impossible constraints

Clang / LLVM says:

$ clang small.c
Assertion failed: (i == DstIdx || !mi->getOperand(i).isReg() ||
mi->getOperand(i).getReg() != regA), function runOnMachineFunction, file
/Volumes/Data/g/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp, line 1140.

This type of error is probably too hard for the frontend to detect, but the
backend should give a better error message.

-- 
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