[llvm-bugs] [Bug 35972] New: [X86] "Unexpected illegal type!" in LegalizeDAG.cpp

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 16 09:25:48 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=35972

            Bug ID: 35972
           Summary: [X86] "Unexpected illegal type!" in LegalizeDAG.cpp
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: ilia.taraban at intel.com
                CC: llvm-bugs at lists.llvm.org

This test fails at compilation with "Unexpected illegal type!" in
LegalizeDAG.cpp:

================= nice.c ==============

void foo (int p, int n)
{
    int i;
    char * a = 0;
    for (i = n; i < 0; i++) 
    {
        if (! p) 
            a[i] = a[0];
    }
}

=======================================

>>> clang -v
clang version 6.0.0 (trunk 322555)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...

>>> clang -m32 -c -O2 -march=skx nice.c
clang-7.0: .../llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1002: void
{anonymous}::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*): Assertion
`(TLI.getTypeAction(*DAG.getContext(), Op.getValueType()) ==
TargetLowering::TypeLegal || TLI.isTypeLegal(Op.getValueType()) ||
Op.getOpcode() == ISD::TargetConstant || Op.getOpcode() == ISD::Register) &&
"Unexpected illegal type!"' failed.
#0 0x00000000041b222d llvm::sys::PrintStackTrace(llvm::raw_ostream&)
.../llvm/lib/Support/Unix/Signals.inc:398:0
#1 0x00000000041b22be PrintStackTraceSignalHandler(void*)
.../llvm/lib/Support/Unix/Signals.inc:462:0
#2 0x00000000041b07a4 llvm::sys::RunSignalHandlers()
.../llvm/lib/Support/Signals.cpp:49:0
#3 0x00000000041b1bc5 SignalHandler(int)
.../llvm/lib/Support/Unix/Signals.inc:252:0
#4 0x00007f59024775e0 __restore_rt (/lib64/libpthread.so.0+0xf5e0)
#5 0x00007f590106f1f7 __GI_raise (/lib64/libc.so.6+0x351f7)
#6 0x00007f59010708e8 __GI_abort (/lib64/libc.so.6+0x368e8)
#7 0x00007f5901068266 __assert_fail_base (/lib64/libc.so.6+0x2e266)
#8 0x00007f5901068312 (/lib64/libc.so.6+0x2e312)
#9 0x0000000004df218e (anonymous
namespace)::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*)
.../llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:996:0
#10 0x0000000004e12942 llvm::SelectionDAG::Legalize()
.../llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:4726:0
#11 0x0000000004ec4552 llvm::SelectionDAGISel::CodeGenAndEmitDAG()
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:834:0
#12 0x0000000004ec307e
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,
true, false, void>, false, true>,
llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true,
false, void>, false, true>, bool&)
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:665:0
#13 0x0000000004ec89a0
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1627:0
#14 0x0000000004ec1d5f
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:467:0
#15 0x0000000002f91748 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
.../llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:176:0
#16 0x000000000363b55f
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
.../llvm/lib/CodeGen/MachineFunctionPass.cpp:62:0
#17 0x0000000003a88a42 llvm::FPPassManager::runOnFunction(llvm::Function&)
.../llvm/lib/IR/LegacyPassManager.cpp:1520:0
#18 0x0000000003a88bd5 llvm::FPPassManager::runOnModule(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1541:0
#19 0x0000000003a88f61 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1597:0
#20 0x0000000003a89652 llvm::legacy::PassManagerImpl::run(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1700:0
#21 0x0000000003a89893 llvm::legacy::PassManager::run(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1732:0
#22 0x0000000004456281 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
.../llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:822:0
#23 0x0000000004458a7a clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
.../llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:1191:0
#24 0x0000000004fa3af1
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
.../llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:294:0
#25 0x0000000005c70f9a clang::ParseAST(clang::Sema&, bool, bool)
.../llvm/tools/clang/lib/Parse/ParseAST.cpp:161:0
#26 0x0000000004ab5024 clang::ASTFrontendAction::ExecuteAction()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:1007:0
#27 0x0000000004fa1bc2 clang::CodeGenAction::ExecuteAction()
.../llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1032:0
#28 0x0000000004ab4a65 clang::FrontendAction::Execute()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:908:0
#29 0x0000000004a54a84
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
.../llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:992:0
#30 0x0000000004beed00
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
.../llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#31 0x0000000002127678 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) .../llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#32 0x000000000211d144 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) .../llvm/tools/clang/tools/driver/driver.cpp:309:0
#33 0x000000000211dddb main .../llvm/tools/clang/tools/driver/driver.cpp:389:0
#34 0x00007f590105bc05 __libc_start_main (/lib64/libc.so.6+0x21c05)
#35 0x000000000211a9c9 _start (.../debug_build/bin/clang-7.0+0x211a9c9)
Stack dump:
0.      Program arguments: .../debug_build/bin/clang-7.0 -cc1 -triple
i386-unknown-linux-gnu -emit-obj -disable-free -main-file-name nice.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -fuse-init-array -target-cpu skx -dwarf-column-info
-debugger-tuning=gdb -momit-leaf-frame-pointer -coverage-notes-file
temp/nice.gcno -resource-dir .../debug_build/lib/clang/7.0.0 -c-isystem
.../last_debug/projects/openmp/runtime/src -c-isystem . -cxx-isystem
.../last_debug/projects/openmp/runtime/src -cxx-isystem . -internal-isystem
/usr/local/include -internal-isystem .../debug_build/lib/clang/7.0.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O2
-fdebug-compilation-dir temp -ferror-limit 19 -fmessage-length 0
-fobjc-runtime=gcc -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o
nice.o -x c nice.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'nice.c'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@foo'
clang-7.0: error: unable to execute command: Aborted (core dumped)
clang-7.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.0 (trunk 322555)
Target: i386-unknown-linux-gnu
Thread model: posix
InstalledDir: .../last_debug/bin
clang-7.0: 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-7.0: note: diagnostic msg: 
********************

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

********************



It starts failing after r322057, but ll reproducer fails on older builds.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180116/028e6418/attachment-0001.html>


More information about the llvm-bugs mailing list