[LLVMbugs] [Bug 3759] New: Assertion `i < getNumOperands() && "getOperand() out of range!"' failed.
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Sun Mar 8 13:02:52 PDT 2009
http://llvm.org/bugs/show_bug.cgi?id=3759
Summary: Assertion `i < getNumOperands() && "getOperand() out of
range!"' failed.
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Common Code Generator Code
AssignedTo: unassignedbugs at nondot.org
ReportedBy: castet.matthieu at free.fr
CC: llvmbugs at cs.uiuc.edu
Hi,
I am trying to build ffmpeg with clang/llvm using r66380.
But I got "getOperand() out of range!" assertion on some files [1][2].
I don't know what you need to investigate the issue (I failed to create a small
testcase and -debug produce very large data).
To reproduce the problem :
$ svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
$ cd ffmpeg
$ ./configure --cc=ccc --enable-gpl --cpu=athlon-xp
$ clang -S -disable-free --relocation-model=static --unwind-tables=0
--fmath-errno=0 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -I. -I./ffmpeg -g -O3 -Wundef
-std=c99 -o /tmp/tmpiqN2l-.s -x c ./libavcodec/motion_est.c
( using $ make should also show the problem)
[1]
$clang -S -disable-free --relocation-model=static --unwind-tables=0
--fmath-errno=0 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -I. -I/home/mat/appli/ffmpeg -g -O3
-Wundef -std=c99 -o /tmp/tmpiqN2l-.s -x c
/home/mat/appli/ffmpeg/libavcodec/motion_est.c
clang: /mnt/data/tmp/llvm/llvm/include/llvm/CodeGen/MachineInstr.h:129:
llvm::MachineOperand& llvm::MachineInstr::getOperand(unsigned int): Assertion
`i < getNumOperands() && "getOperand() out of range!"' failed.
0 clang 0x08ddf9ee
1 clang 0x08ddff95
2 0xb7f8d400 __kernel_sigreturn + 0
3 libc.so.6 0xb7d07008 abort + 392
4 libc.so.6 0xb7cfe5ce __assert_fail + 238
5 clang 0x08492b22
6 clang 0x08b26f6b
7 clang 0x08b2be55
8 clang 0x08b2e18d
9 clang 0x08adc532
10 clang 0x0848bbf2
11 clang 0x08d6420c
12 clang 0x08d64cfa
13 clang 0x08d64e83
14 clang 0x0807ee8c
15 clang 0x0807ef8a
16 clang 0x082117ba
17 clang 0x080c64a6
18 clang 0x080c8799 main + 2016
19 libc.so.6 0xb7cf0775 __libc_start_main + 229
20 clang 0x080664f1
Stack dump:
0. Program arguments: clang -S -disable-free --relocation-model=static
--unwind-tables=0 --fmath-errno=0 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -I.
-I/home/mat/appli/ffmpeg -g -O3 -Wundef -std=c99 -o /tmp/tmpiqN2l-.s -x c
/home/mat/appli/ffmpeg/libavcodec/motion_est.c -regalloc=local
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Linear Scan Register Allocator' on function
'@sad_hpel_motion_search'
Abandon
[2]
(gdb) r -S -disable-free --relocation-model=static --unwind-tables=0
--fmath-errno=0 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -I. -I/home/mat/appli/ffmpeg -g -O3
-Wundef -std=c99 -o /tmp/tmpiqN2l-.s -x c
/home/mat/appli/ffmpeg/libavcodec/motion_est.c
Starting program: /mnt/data/tmp/llvm/llvm/Debug/bin/clang -S -disable-free
--relocation-model=static --unwind-tables=0 --fmath-errno=0 -DHAVE_AV_CONFIG_H
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC99_SOURCE
-D_POSIX_C_SOURCE=200112 -I. -I/home/mat/appli/ffmpeg -g -O3 -Wundef -std=c99
-o /tmp/tmpiqN2l-.s -x c /home/mat/appli/ffmpeg/libavcodec/motion_est.c
[Thread debugging using libthread_db enabled]
clang: /mnt/data/tmp/llvm/llvm/include/llvm/CodeGen/MachineInstr.h:129:
llvm::MachineOperand& llvm::MachineInstr::getOperand(unsigned int): Assertion
`i < getNumOperands() && "getOperand() out of range!"' failed.
[New Thread 0xb7cf86d0 (LWP 17051)]
Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb7cf86d0 (LWP 17051)]
0xb7fad424 in __kernel_vsyscall ()
(gdb) bt
#0 0xb7fad424 in __kernel_vsyscall ()
#1 0xb7d25640 in raise () from /lib/i686/cmov/libc.so.6
#2 0xb7d27008 in abort () from /lib/i686/cmov/libc.so.6
#3 0xb7d1e5ce in __assert_fail () from /lib/i686/cmov/libc.so.6
#4 0x08492b22 in llvm::MachineInstr::getOperand (this=0x9ede350, i=21)
at /mnt/data/tmp/llvm/llvm/include/llvm/CodeGen/MachineInstr.h:129
#5 0x08b26f6b in hasLaterNon2AddrUse (MI=@0x9ede350, i=21, VirtReg=1720)
at VirtRegMap.cpp:1328
#6 0x08b2be55 in RewriteMBB (this=0x9cce658, MBB=@0xaf0946c, VRM=@0xad47b90,
Spills=@0xbfbc82d8, RegKills=@0xbfbc836c, KillOps=@0xbfbc8360)
at VirtRegMap.cpp:1658
#7 0x08b2e18d in runOnMachineFunction (this=0x9cce658, MF=@0xb795818,
VRM=@0xad47b90) at VirtRegMap.cpp:605
#8 0x08adc532 in runOnMachineFunction (this=0xa0bd390, fn=@0xb795818)
at RegAllocLinearScan.cpp:315
#9 0x0848bbf2 in llvm::MachineFunctionPass::runOnFunction (this=0xa0bd390,
F=@0x9c570d8)
at /mnt/data/tmp/llvm/llvm/include/llvm/CodeGen/MachineFunctionPass.h:42
#10 0x08d6420c in llvm::FPPassManager::runOnFunction (this=0xa0ab860,
F=@0x9c570d8) at PassManager.cpp:1327
#11 0x08d64cfa in llvm::FunctionPassManagerImpl::run (this=0xa0ab060,
F=@0x9c570d8) at PassManager.cpp:1284
#12 0x08d64e83 in llvm::FunctionPassManager::run (this=0xa07d3b0, F=@0x9c570d8)
---Type <return> to continue, or q <return> to quit---
at PassManager.cpp:1236
#13 0x0807ee8c in EmitAssembly (this=0x9a80f10) at Backend.cpp:420
#14 0x0807ef8a in HandleTranslationUnit (this=0x9a80f10, TU=@0x9a82700)
at Backend.cpp:151
#15 0x082117ba in clang::ParseAST (PP=@0x9a80ac8, Consumer=0x9a80f10,
TU=0x9a82700, PrintStats=false) at ParseAST.cpp:75
#16 0x080c64a6 in ProcessInputFile (PP=@0x9a80ac8, PPF=@0xbfbc8f7c,
InFile=@0x9a84b98, PA=EmitAssembly) at clang.cpp:1387
#17 0x080c8799 in main (argc=22, argv=0xbfbc90d4) at clang.cpp:1586
(gdb) p this
No symbol "this" in current context.
(gdb) up 3
#3 0xb7d1e5ce in __assert_fail () from /lib/i686/cmov/libc.so.6
(gdb) up
#4 0x08492b22 in llvm::MachineInstr::getOperand (this=0x9ede350, i=21)
at /mnt/data/tmp/llvm/llvm/include/llvm/CodeGen/MachineInstr.h:129
129 assert(i < getNumOperands() && "getOperand() out of range!");
(gdb) p this
$1 = (class llvm::MachineInstr * const) 0x9ede350
(gdb) p *this
$2 = {<llvm::ilist_node<llvm::MachineInstr>> = {Prev = 0xae8a5f8,
Next = 0x9ede400}, TID = 0x9130e84, NumImplicitOps = 0,
Operands = {<std::_Vector_base<llvm::MachineOperand,
std::allocator<llvm::MachineOperand> >> = {
_M_impl = {<std::allocator<llvm::MachineOperand>> =
{<__gnu_cxx::new_allocator<llvm::MachineOperand>> = {<No data fields>}, <No
data fields>},
_M_start = 0xbf16a70, _M_finish = 0xbf16c14,
_M_end_of_storage = 0xbf16cf0}}, <No data fields>},
MemOperands = {<std::_List_base<llvm::MachineMemOperand,
std::allocator<llvm::MachineMemOperand> >> = {
_M_impl = {<std::allocator<std::_List_node<llvm::MachineMemOperand> >> =
{<__gnu_cxx::new_allocator<std::_List_node<llvm::MachineMemOperand> >> = {<No
data fields>}, <No data fields>}, _M_node = {_M_next = 0x9ede36c,
_M_prev = 0x9ede36c}}}, <No data fields>}, Parent = 0xaf0946c,
debugLoc = {Idx = 4294967295}}
--
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