llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.04k stars 11.98k forks source link

Assertion `(TLI.getTypeAction(*DAG.getContext(), Node->getOperand(i).getValueType()) == TargetLowering::TypeLegal || Node->getOperand(i).getOpcode() == ISD::TargetConstant) && "Unexpected illegal type!"' failed. #17861

Closed regehr closed 11 years ago

regehr commented 11 years ago
Bugzilla Link 17487
Resolution FIXED
Resolved on Oct 16, 2013 09:17
Version trunk
OS Linux
CC @d0k

Extended Description

[regehr@imp r108]$ cat small.c
int a, b;
long long c;
int main(void) {
  int d = 1, e = 0;
  int *f = &a;
  b = 0 != ((*f && d) + (long long)(c || *f || e < 0) ^ 1);
  return 0;
}

[regehr@imp r108]$ clang -v
clang version 3.4 (trunk 192067)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.5.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.3
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6

[regehr@imp r108]$ clang -c -O -m32 small.c
clang: /mnt/local/randomtest/compiler-source/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1154: void {anonymous}::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*): Assertion `(TLI.getTypeAction(*DAG.getContext(), Node->getOperand(i).getValueType()) == TargetLowering::TypeLegal || Node->getOperand(i).getOpcode() == ISD::TargetConstant) && "Unexpected illegal type!"' failed.
0  clang           0x00000000025897d2 llvm::sys::PrintStackTrace(_IO_FILE*) + 34
1  clang           0x0000000002588bb9
2  libpthread.so.0 0x00007ffff7bcccb0
3  libc.so.6       0x00007ffff6bf7425 gsignal + 53
4  libc.so.6       0x00007ffff6bfab8b abort + 379
5  libc.so.6       0x00007ffff6bf00ee
6  libc.so.6       0x00007ffff6bf0192
7  clang           0x0000000001dcf7ce
8  clang           0x0000000001dd0840 llvm::SelectionDAG::Legalize() + 384
9  clang           0x0000000001d80b34 llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 1044
10 clang           0x0000000001d89fdc llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 2124
11 clang           0x0000000001d8ba48 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1416
12 clang           0x000000000251a9bf llvm::FPPassManager::runOnFunction(llvm::Function&) + 607
13 clang           0x000000000251aa2b llvm::FPPassManager::runOnModule(llvm::Module&) + 43
14 clang           0x000000000251a4c0 llvm::MPPassManager::runOnModule(llvm::Module&) + 688
15 clang           0x000000000251a695 llvm::PassManagerImpl::run(llvm::Module&) + 245
16 clang           0x000000000090c0c2 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 3650
17 clang           0x000000000090958d
18 clang           0x0000000000aafbd4 clang::ParseAST(clang::Sema&, bool, bool) + 372
19 clang           0x000000000077e51a clang::FrontendAction::Execute() + 282
20 clang           0x0000000000760bf0 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 352
21 clang           0x000000000074681a clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1722
22 clang           0x000000000073faf0 cc1_main(char const**, char const**, char const*, void*) + 1232
23 clang           0x000000000072382e main + 622
24 libc.so.6       0x00007ffff6be276d __libc_start_main + 237
25 clang           0x000000000073f4ad
Stack dump:
0.  Program arguments: /mnt/local/randomtest/compiler-install/llvm-r192067-install/bin/clang -cc1 -triple i386-unknown-linux-gnu -emit-obj -disable-free -main-file-name small.c -mrelocation-model static -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -target-linker-version 2.22 -momit-leaf-frame-pointer -coverage-file /users/regehr/z/reduce/r108/small.o -resource-dir /mnt/local/randomtest/compiler-install/llvm-r192067-install/bin/../lib/clang/3.4 -internal-isystem /usr/local/include -internal-isystem /mnt/local/randomtest/compiler-install/llvm-r192067-install/bin/../lib/clang/3.4/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir /users/regehr/z/reduce/r108 -ferror-limit 19 -fmessage-length 131 -mstackrealign -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o small.o -x c small.c 
1.  <eof> parser at end of file
2.  Code generation
3.  Running pass 'Function Pass Manager' on module 'small.c'.
4.  Running pass 'X86 DAG->DAG Instruction Selection' on function '@main'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.4 (trunk 192067)
Target: i386-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/small-0c9cec.c
clang: note: diagnostic msg: /tmp/small-0c9cec.sh
clang: note: diagnostic msg: 

********************
d0k commented 11 years ago

off by one: r192795

d0k commented 11 years ago

Fixed in r192794.