<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - [skx][debug] debug clang fails with assertion on "X86 DAG->DAG Instruction Selection" after Loop Vectorization"
href="https://bugs.llvm.org/show_bug.cgi?id=34657">34657</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[skx][debug] debug clang fails with assertion on "X86 DAG->DAG Instruction Selection" after Loop Vectorization
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ilia.taraban@intel.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>This test fails with error in "X86DAGToDAGISel" after "Loop Vectorization" with
debug compiler on compilation on O2, skx
================= nice.c ==============
unsigned int s = 0;
unsigned short r = 0;
unsigned int p = 0;
unsigned long k = 0;
unsigned int i [20] = {0};
unsigned char b [20] = {0};
unsigned int n1 [20] = {0};
unsigned int u [20] = {0};
int main ()
{
for (k = 3; k <= 7; k++)
{
unsigned int ya6 = 0;
b[k + 8] = - n1[0];
n1[k] = p * r * s;
for (ya6 = 0; ya6 <= k; ya6 += 2)
{
unsigned long r = 0;
p = i[k];
i[0] += u[0];
for (r = 2; r <= ya6; r += 7)
u[0] += b[r];
}
}
return 0;
}
============================================
<span class="quote">>>> clang -v</span >
clang version 6.0.0 (trunk 313529)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...
<span class="quote">>>> clang -march=skx -O2 -o nice.exe nice.c</span >
clang-6.0: .../llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:3439:
llvm::SDValue FoldCONCAT_VECTORS(const llvm::SDLoc&, llvm::EVT,
llvm::ArrayRef<llvm::SDValue>, llvm::SelectionDAG&): Assertion
`llvm::all_of(Ops, [Ops](SDValue Op) { return Ops[0].getValueType() ==
Op.getValueType(); }) && "Concatenation of vectors with inconsistent value
types!"' failed.
#0 0x0000000003f57725 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
.../llvm/lib/Support/Unix/Signals.inc:398:0
#1 0x0000000003f577b6 PrintStackTraceSignalHandler(void*)
.../llvm/lib/Support/Unix/Signals.inc:462:0
#2 0x0000000003f55ca2 llvm::sys::RunSignalHandlers()
.../llvm/lib/Support/Signals.cpp:49:0
#3 0x0000000003f570bd SignalHandler(int)
.../llvm/lib/Support/Unix/Signals.inc:252:0
#4 0x00007f0609f51100 __restore_rt (/lib64/libpthread.so.0+0xf100)
#5 0x00007f0608b495f7 __GI_raise (/lib64/libc.so.6+0x355f7)
#6 0x00007f0608b4ace8 __GI_abort (/lib64/libc.so.6+0x36ce8)
#7 0x00007f0608b42566 __assert_fail_base (/lib64/libc.so.6+0x2e566)
#8 0x00007f0608b42612 (/lib64/libc.so.6+0x2e612)
#9 0x0000000004bd6224 FoldCONCAT_VECTORS(llvm::SDLoc const&, llvm::EVT,
llvm::ArrayRef<llvm::SDValue>, llvm::SelectionDAG&)
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:3440:0
#10 0x0000000004bdbd4c llvm::SelectionDAG::getNode(unsigned int, llvm::SDLoc
const&, llvm::EVT, llvm::SDValue, llvm::SDValue, llvm::SDNodeFlags)
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:4169:0
#11 0x0000000004be8902 llvm::SelectionDAG::getNode(unsigned int, llvm::SDLoc
const&, llvm::EVT, llvm::ArrayRef<llvm::SDValue>, llvm::SDNodeFlags)
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:6191:0
#12 0x0000000004c8ce4d
llvm::DAGTypeLegalizer::GenWidenVectorLoads(llvm::SmallVectorImpl<llvm::SDValue>&,
llvm::LoadSDNode*)
.../llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:3871:0
#13 0x0000000004c84a3d llvm::DAGTypeLegalizer::WidenVecRes_LOAD(llvm::SDNode*)
.../llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:2894:0
#14 0x0000000004c7e7fb llvm::DAGTypeLegalizer::WidenVectorResult(llvm::SDNode*,
unsigned int) .../llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:2184:0
#15 0x0000000004c5b7de llvm::DAGTypeLegalizer::run()
.../llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:274:0
#16 0x0000000004c60b2b llvm::SelectionDAG::LegalizeTypes()
.../llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:1206:0
#17 0x0000000004c10825 llvm::SelectionDAGISel::CodeGenAndEmitDAG()
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:759:0
#18 0x0000000004c0fe7c
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:666:0
#19 0x0000000004c15425
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1614:0
#20 0x0000000004c0eb3d
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:467:0
#21 0x0000000002dd34c8 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
.../llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:178:0
#22 0x000000000343fc7b
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
.../llvm/lib/CodeGen/MachineFunctionPass.cpp:62:0
#23 0x0000000003881996 llvm::FPPassManager::runOnFunction(llvm::Function&)
.../llvm/lib/IR/LegacyPassManager.cpp:1514:0
#24 0x0000000003881b29 llvm::FPPassManager::runOnModule(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1535:0
#25 0x0000000003881eb5 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1591:0
#26 0x00000000038825a6 llvm::legacy::PassManagerImpl::run(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1694:0
#27 0x00000000038827e7 llvm::legacy::PassManager::run(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1726:0
#28 0x00000000041e4c95 (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:794:0
#29 0x00000000041e7297 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:1145:0
#30 0x0000000004cf0a1d
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
.../llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:288:0
#31 0x00000000059670ba clang::ParseAST(clang::Sema&, bool, bool)
.../llvm/tools/clang/lib/Parse/ParseAST.cpp:161:0
#32 0x000000000480bc04 clang::ASTFrontendAction::ExecuteAction()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:1000:0
#33 0x0000000004cee9e6 clang::CodeGenAction::ExecuteAction()
.../llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1018:0
#34 0x000000000480b645 clang::FrontendAction::Execute()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:901:0
#35 0x00000000047add3a
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
.../llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:991:0
#36 0x000000000494217a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
.../llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#37 0x0000000001fea6d1 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) .../llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#38 0x0000000001fe03e1 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) .../llvm/tools/clang/tools/driver/driver.cpp:302:0
#39 0x0000000001fe1069 main .../llvm/tools/clang/tools/driver/driver.cpp:381:0
#40 0x00007f0608b35b15 __libc_start_main (/lib64/libc.so.6+0x21b15)
#41 0x0000000001fddc99 _start (.../build_313529_DONE/bin/clang-6.0+0x1fddc99)
Stack dump:
0. Program arguments: .../build_313529_DONE/bin/clang-6.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name nice.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu skx
-dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -resource-dir
.../build_313529_DONE/lib/clang/6.0.0 -internal-isystem /usr/local/include
-internal-isystem .../build_313529_DONE/lib/clang/6.0.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O2
-fdebug-compilation-dir test -ferror-limit 19 -fmessage-length 189
-fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-loops -vectorize-slp -o /tmp/nice-1f361d.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 '@main'
clang-6.0: error: unable to execute command: Aborted
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (trunk 313529)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: .../build_313529_DONE/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-6.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-6.0: note: diagnostic msg: /tmp/nice-940597.c
clang-6.0: note: diagnostic msg: /tmp/nice-940597.sh
clang-6.0: note: diagnostic msg:
********************
<span class="quote">>>> clang nice.c -O2 -march=skx -mllvm -opt-bisect-limit=71</span >
BISECT: running pass (69) Rotate Loops on loop
BISECT: running pass (70) Rotate Loops on loop
BISECT: running pass (71) Loop Distribution on function (main)
BISECT: NOT running pass (72) Loop Vectorization on function (main)
BISECT: NOT running pass (73) Loop Load Elimination on function (main)
<span class="quote">>>> echo $?</span >
0
<span class="quote">>>> clang nice.c -O2 -march=skx -mllvm -opt-bisect-limit=72</span >
...
BISECT: running pass (71) Loop Distribution on function (main)
BISECT: running pass (72) Loop Vectorization on function (main)
BISECT: NOT running pass (73) Loop Load Elimination on function (main)
...
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 '@main'
clang-6.0: error: unable to execute command: Aborted
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (trunk 313529)
...</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>