[llvm-bugs] [Bug 35443] New: [SKX] "Cannot BITCAST between types of different sizes!" in 'X86 DAG->DAG Instruction Selection'

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 28 03:38:12 PST 2017


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

            Bug ID: 35443
           Summary: [SKX] "Cannot BITCAST between types of different
                    sizes!" in 'X86 DAG->DAG Instruction Selection'
           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 "fatal error: error in backend: Cannot
select" on release and "Cannot BITCAST between types of different sizes!" on
debug using O2 level and skx march.
================= nice.c ==============
unsigned char c = 0;
unsigned int i = 0;
unsigned long l = 0;
unsigned char ac [20] = {0};
unsigned int ai1 [20] = {0};
unsigned int ai2 [20] = {0};
unsigned int ai3 [20] = {0};
unsigned long al [20] = {0};
int main ()
{
    for (c = 4; c <= 7; c++) 
    {
        unsigned int o = 0;
        al[c + 1] ^= 5;
        ai3[c] = ai2[c + 5] + (4 >= c ? ai2[c] * i * l + i + ai1[c] - ac[c] + c
: -c * ai1[c]);
        for (o = c; o <= 3; o += 9) 
            l -= (ai1[o]);
    }
    return 0;
}

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

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

Release:
>>> clang -c -O2 -march=skx nice.c
fatal error: error in backend: Cannot select: 0x6a6f240: v4i64 = bitcast
0x6a6ca20
  0x6a6ca20: v4i32 = X86ISD::VZEXT_MOVL 0x6a6c610
    0x6a6c610: v4i32 = scalar_to_vector 0x6a6c2d0
      0x6a6c2d0: i32,ch = load<LD1[bitcast (i8* getelementptr inbounds ([20 x
i8], [20 x i8]* @ac, i64 0, i64 4) to <4 x i8>*)](align=4), zext from i8>
0x6a864c0:1, 0x6a6d038, undef:i64
        0x6a6d038: i64 = X86ISD::Wrapper TargetGlobalAddress:i64<[20 x i8]*
@ac> + 4
          0x6a6cc90: i64 = TargetGlobalAddress<[20 x i8]* @ac> + 4
        0x6a85758: i64 = undef
In function: main
clang-6.0: error: clang frontend command failed with exit code 70 (use -v to
see invocation)
clang version 6.0.0 (trunk 319159)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /export/users/itaraban/compilers/last_release/bin
clang-6.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-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/atg_comp_DAG-98d363.c
clang-6.0: note: diagnostic msg: /tmp/atg_comp_DAG-98d363.sh
clang-6.0: note: diagnostic msg:

********************
Debug:
>>> clang -c -O2 -march=skx nice.c
clang-6.0: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:3875: llvm::SDValue
llvm::SelectionDAG::getNode(unsigned int, const llvm::SDLoc&, llvm::EVT,
llvm::SDValue, llvm::SDNodeFlags): Assertion `VT.getSizeInBits() ==
Operand.getValueSizeInBits() && "Cannot BITCAST between types of different
sizes!"' failed.
#0 0x00000000040b6977 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
llvm/lib/Support/Unix/Signals.inc:398:0
#1 0x00000000040b6a08 PrintStackTraceSignalHandler(void*)
llvm/lib/Support/Unix/Signals.inc:462:0
#2 0x00000000040b4eee llvm::sys::RunSignalHandlers()
llvm/lib/Support/Signals.cpp:49:0
#3 0x00000000040b630f SignalHandler(int)
llvm/lib/Support/Unix/Signals.inc:252:0
#4 0x00007f96a8d965e0 __restore_rt (/lib64/libpthread.so.0+0xf5e0)
#5 0x00007f96a79881f7 __GI_raise (/lib64/libc.so.6+0x351f7)
#6 0x00007f96a79898e8 __GI_abort (/lib64/libc.so.6+0x368e8)
#7 0x00007f96a7981266 __assert_fail_base (/lib64/libc.so.6+0x2e266)
#8 0x00007f96a7981312 (/lib64/libc.so.6+0x2e312)
#9 0x0000000004d65cad llvm::SelectionDAG::getNode(unsigned int, llvm::SDLoc
const&, llvm::EVT, llvm::SDValue, llvm::SDNodeFlags)
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:3876:0
#10 0x0000000004d58b91 llvm::SelectionDAG::getBitcast(llvm::EVT, llvm::SDValue)
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1765:0
#11 0x0000000002f34066 lowerVectorShuffleAsElementInsertion(llvm::SDLoc const&,
llvm::MVT, llvm::SDValue, llvm::SDValue, llvm::ArrayRef<int>, llvm::APInt
const&, llvm::X86Subtarget const&, llvm::SelectionDAG&)
llvm/lib/Target/X86/X86ISelLowering.cpp:10190:0
#12 0x0000000002f4d437 lower256BitVectorShuffle(llvm::SDLoc const&,
llvm::ArrayRef<int>, llvm::MVT, llvm::SDValue, llvm::SDValue, llvm::APInt
const&, llvm::X86Subtarget const&, llvm::SelectionDAG&)
llvm/lib/Target/X86/X86ISelLowering.cpp:13575:0
#13 0x0000000002f53405 lowerVectorShuffle(llvm::SDValue, llvm::X86Subtarget
const&, llvm::SelectionDAG&) llvm/lib/Target/X86/X86ISelLowering.cpp:14338:0
#14 0x0000000002fae93f llvm::X86TargetLowering::LowerOperation(llvm::SDValue,
llvm::SelectionDAG&) const llvm/lib/Target/X86/X86ISelLowering.cpp:24444:0
#15 0x0000000004cce19c (anonymous
namespace)::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*)
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1201:0
#16 0x0000000004ced928 llvm::SelectionDAG::Legalize()
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:4672:0
#17 0x0000000004d9df28 llvm::SelectionDAGISel::CodeGenAndEmitDAG()
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:821:0
#18 0x0000000004d9cbf8
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
#19 0x0000000004da21f1
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1610:0
#20 0x0000000004d9b8d9
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:467:0
#21 0x0000000002ebdde8 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:178:0
#22 0x000000000355e3bf
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
llvm/lib/CodeGen/MachineFunctionPass.cpp:62:0
#23 0x00000000039a522c llvm::FPPassManager::runOnFunction(llvm::Function&)
llvm/lib/IR/LegacyPassManager.cpp:1514:0
#24 0x00000000039a53bf llvm::FPPassManager::runOnModule(llvm::Module&)
llvm/lib/IR/LegacyPassManager.cpp:1535:0
#25 0x00000000039a574b (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
llvm/lib/IR/LegacyPassManager.cpp:1591:0
#26 0x00000000039a5e3c llvm::legacy::PassManagerImpl::run(llvm::Module&)
llvm/lib/IR/LegacyPassManager.cpp:1694:0
#27 0x00000000039a607d llvm::legacy::PassManager::run(llvm::Module&)
llvm/lib/IR/LegacyPassManager.cpp:1726:0
#28 0x00000000043560f3 (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:795:0
#29 0x0000000004358830 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:1161:0
#30 0x0000000004e7d3e9
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:294:0
#31 0x0000000005b0c966 clang::ParseAST(clang::Sema&, bool, bool)
llvm/tools/clang/lib/Parse/ParseAST.cpp:161:0
#32 0x0000000004996e0c clang::ASTFrontendAction::ExecuteAction()
llvm/tools/clang/lib/Frontend/FrontendAction.cpp:1000:0
#33 0x0000000004e7b4a0 clang::CodeGenAction::ExecuteAction()
llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1032:0
#34 0x000000000499684d clang::FrontendAction::Execute()
llvm/tools/clang/lib/Frontend/FrontendAction.cpp:901:0
#35 0x0000000004938568
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:992:0
#36 0x0000000004acec9a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#37 0x00000000020af9d6 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#38 0x00000000020a56f4 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) llvm/tools/clang/tools/driver/driver.cpp:309:0
#39 0x00000000020a637d main llvm/tools/clang/tools/driver/driver.cpp:388:0
#40 0x00007f96a7974c05 __libc_start_main (/lib64/libc.so.6+0x21c05)
#41 0x00000000020a2f79 _start (debug_build/bin/clang-6.0+0x20a2f79)
Stack dump:
0.      Program arguments: debug_build/bin/clang-6.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name atg_comp_DAG.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
-coverage-notes-file test_dir/nice.gcno -resource-dir
debug_build/lib/clang/6.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/6.0.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir test_dir
-ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc
-fdiagnostics-show-option -vectorize-loops -vectorize-slp -o atg_comp_DAG.o -x
c atg_comp_DAG.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'atg_comp_DAG.c'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@main'
clang-6.0: error: unable to execute command: Aborted (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (trunk 319159)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: last_debug/bin
clang-6.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-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/atg_comp_DAG-b8d653.c
clang-6.0: note: diagnostic msg: /tmp/atg_comp_DAG-b8d653.sh
clang-6.0: note: diagnostic msg: 

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

-- 
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/20171128/712071b4/attachment-0001.html>


More information about the llvm-bugs mailing list