[LLVMbugs] [Bug 8093] New: Assertion failed: (0 && "Unknown immediate size"), function getSizeOfImm, file X86InstrInfo.h, line 486.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 6 10:44:46 PDT 2010


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

           Summary: Assertion failed: (0 && "Unknown immediate size"),
                    function getSizeOfImm, file X86InstrInfo.h, line 486.
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rdivacky at freebsd.org
                CC: llvmbugs at cs.uiuc.edu


pes delta$ cat x.c
void
bus_space_read_multi_2(void)
{ 
  __asm volatile  ("1: loop 1b");
}
pes delta$ clang -integrated-as x.c
<MCInst 1998 <MCOperand Reg:99>>
<MCInst 1401 <MCOperand Reg:99> <MCOperand Reg:107>>
<MCInst 1135 <MCOperand Expr:(".L11")>>
Assertion failed: (0 && "Unknown immediate size"), function getSizeOfImm, file
X86InstrInfo.h, line 486.
Stack dump:
0.      Program arguments: clang -integrated-as x.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'X86 AT&T-Style Assembly Printer' on function
'@bus_space_read_multi_2'
Abort (core dumped)

with Inst.dump() in MCStreamer::EmitInstruction(). This reproduces on both
ELF/MachO.

the problem here is with the encoding of the loop instruction. it tries to get
the size of the immediate by:

TSFlags & X86II::ImmMask

but TSFLags is 0xE2000001 (in debugger, in X86GenInstrInfo.inc it's defined to
be 0xe200002bULL) and X86II::ImmMask is E000 so it clearly does not match. I
think that the TSFLags are wrong

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