[LLVMbugs] [Bug 9506] New: CodeGen assert on i386/idivl

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 18 06:16:56 PDT 2011


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

           Summary: CodeGen assert on i386/idivl
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: pageexec at freemail.hu
                CC: llvmbugs at cs.uiuc.edu, pageexec at freemail.hu
            Blocks: 4068


the following code extracted from linux/arch/x86/kvm/emulate.c triggers an
assert with r127872.

void f(void)
{
        unsigned long _tmp, _rax, _rdx, _val, _eflags;
        unsigned char _ex;

        __asm__ __volatile__ (
                "idivl %6;"
                : "=m" (_eflags), "=&r" (_tmp),
                  "+a" (_rax), "+d" (_rdx), "+qm"(_ex)
                : "i" (0x1234), "m" (_val),
                  "a" (_rax), "d" (_rdx));
}

clang output:

clang: /src/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1159: virtual
bool<unnamed>::TwoAddressInstructionPass::runOnMachineFunction(llvm::MachineFunction&):
Assertion `i == DstIdx || !mi->getOperand(i).isReg() ||
mi->getOperand(i).getReg() != regA' failed.
0  libLLVM-3.0svn.so 0xa16c10b8
Stack dump:
0.      Program arguments: clang -cc1 -triple i386-pc-linux-gnu -emit-obj
-mrelax-all -disable-free -main-file-name a.c -mrelocation-model static
-mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu pentium4
-target-linker-version 2.21 -momit-leaf-frame-pointer -resource-dir
/src/build.i386/bin/../lib/clang/3.0 -ferror-limit 19 -fmessage-length 277
-fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o a.o -x c a.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'a.c'.
4.      Running pass 'Two-Address instruction pass' on function '@f'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)

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