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 4752 - [inline asm] Assertion failed: "Interval does not exist for register" / LLVM ERROR: Ran out of registers during register allocation!
Summary: [inline asm] Assertion failed: "Interval does not exist for register" / LLVM ...
Status: RESOLVED FIXED
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: unspecified
Hardware: PC Linux
: P normal
Assignee: Evan Cheng
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-22 09:14 PDT by Dmitry Gorbachev
Modified: 2010-07-07 13:30 PDT (History)
4 users (show)

See Also:
Fixed By Commit(s):


Attachments
ZIP archive with C and BC files (1.63 KB, application/zip)
2009-08-22 09:14 PDT, Dmitry Gorbachev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Gorbachev 2009-08-22 09:14:21 PDT
Created attachment 3354 [details]
ZIP archive with C and BC files

Two errors, depending on optimization level. LLVM r79531.
Comment 1 Dmitry Gorbachev 2009-09-17 00:02:33 PDT
No crash with -regalloc=simple, but wrong is generated.
Comment 2 Dmitry Gorbachev 2009-09-17 00:03:56 PDT
(In reply to comment #1)

Wrong code, I mean. :)
Comment 3 Evan Cheng 2010-02-09 01:49:14 PST
Is this still broken with tot?
Comment 4 Dmitry Gorbachev 2010-02-13 15:27:26 PST
In r96110:

$ llc -regalloc=linearscan bug-O1.bc
llc: /tmp/llvm/lib/CodeGen/RegAllocLinearScan.cpp:1183: void<unnamed>::RALinScan::assignRegOrStackSlotAtInterval(llvm::LiveInterval*): Assertion `false && "Ran out of registers during register allocation!"' failed.
0  llc 0x08764913
Stack dump:
0.	Program arguments: llc -regalloc=linearscan bug-O1.bc 
1.	Running pass 'Linear Scan Register Allocator' on function '@g'
Aborted

$ llc -regalloc=local bug-O1.bc
LLVM ERROR: Ran out of registers during register allocation!
Please check your inline asm statement for invalid constraints:
INLINEASM <es:push	$0
	call	${1:a}
	pop	%edx>, 11, %EBP<kill>, 11, %EBP<kill>, 14, %AX<earlyclobber,def,dead>, 14, %BX<earlyclobber,def,dead>, 14, %CX<earlyclobber,def,dead>, 14, %DX<earlyclobber,def,dead>, 14, %SI<earlyclobber,def,dead>, 14, %DI<earlyclobber,def,dead>, 14, %EFLAGS<earlyclobber,def,dead>

$ llc -regalloc=pbqp bug-O1.bc
llc: /tmp/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1668: std::vector<llvm::LiveInterval*, std::allocator<llvm::LiveInterval*> > llvm::LiveIntervals::addIntervalsForSpills(const llvm::LiveInterval&, llvm::SmallVectorImpl<llvm::LiveInterval*>&, const llvm::MachineLoopInfo*, llvm::VirtRegMap&): Assertion `li.weight != (__builtin_huge_valf()) && "attempt to spill already spilled interval!"' failed.
0  llc 0x08764913
Stack dump:
0.	Program arguments: llc -regalloc=pbqp bug-O1.bc 
1.	Running pass 'PBQP Register Allocator' on function '@g'
Aborted
Comment 5 Dale Johannesen 2010-06-28 16:02:59 PDT
I believe this is fixed as of 106893.  (Note that &f is not valid with "i" in PIC modes, as the address cannot be computed at linktime.)
Comment 6 Dale Johannesen 2010-07-07 13:30:25 PDT
&f should actually work with "i" in RIP-relative mode, which is default on Darwin x86-64.  Fixed in 107727.