LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 1259 - LiveVars assertion handling inline assembler.
Summary: LiveVars assertion handling inline assembler.
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Backend: X86 (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords: compile-fail
Depends on:
Blocks:
 
Reported: 2007-03-18 12:27 PDT by Anton Korobeynikov
Modified: 2010-02-22 12:46 PST (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments
Failed bytecode. (532 bytes, application/octet-stream)
2007-03-18 12:28 PDT, Anton Korobeynikov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Korobeynikov 2007-03-18 12:27:56 PDT
Consider attached bytecode. LLC results with:

./llc bugpoint-reduced-simplified.bc
llc: /home/asl/proj/llvm/src/lib/CodeGen/LiveInterval.cpp:189: llvm::LiveRange*
llvm::LiveInterval::addRangeFrom(llvm::LiveRange, llvm::LiveRange*): Assertion
`B->end <= Start && "Cannot overlap two LiveRanges with differing ValID's" "
(did you def the same reg twice in a MachineInstr?)"' failed.
./llc((anonymous namespace)::PrintStackTrace()+0x1f)[0x863177f]
/lib/libc.so.6(abort+0xe9)[0xb7d25229]
/lib/libc.so.6(__assert_fail+0xeb)[0xb7d1d4e3]
./llc(llvm::LiveInterval::addRangeFrom(llvm::LiveRange,
llvm::LiveRange*)+0x1ee)[0x84e4a0e]

I don't see anything wrong with the inline assembler itself.
Comment 1 Anton Korobeynikov 2007-03-18 12:28:29 PDT
Created attachment 706 [details]
Failed bytecode.
Comment 2 Anton Korobeynikov 2007-03-18 12:29:44 PDT
Just for information. This is reduction from "test.cpp" found in the 
http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-March/008196.html
Comment 3 Chris Lattner 2007-03-18 18:08:45 PDT
here is a reduced testcase:

define void @test() {
        %tmp2 = call i32 asm "...", "=r,~{dirflag},~{fpsr},~{flags},~{dx},~{cx},~{ax}"( )
        unreachable
}

Here, the isel assigns the result reg to EAX, which creates this invalid MI:
INLINEASM <es:...>, 10, %EAX<def>, 10, %DX<def>, 10, %CX<def>, 10, %AX<def>

The assert is exactly right:
LiveInterval.cpp:189: failed assertion ..." (did you def the same reg twice in a MachineInstr?)"'

-Chris
Comment 4 Evan Cheng 2007-05-21 18:30:28 PDT
Looks like this has been already been fixed.