[llvm-bugs] [Bug 38477] New: A/F: (EltVT.getSizeInBits() >= 64 || (uint64_t)((int64_t)Val >> EltVT.getSizeInBits()) + 1 < 2) && "getConstant with a uint64_t value that doesn't fit in the type!"' failed after r339121

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 7 18:17:32 PDT 2018


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

            Bug ID: 38477
           Summary: A/F: (EltVT.getSizeInBits() >= 64 ||
                    (uint64_t)((int64_t)Val >> EltVT.getSizeInBits()) + 1
                    < 2) && "getConstant with a uint64_t value that
                    doesn't fit in the type!"' failed after r339121
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: douglas_yung at playstation.sony.com
                CC: llvm-bugs at lists.llvm.org

Commit r339121 is causing an assertion failure in several of our internal tests
when compiling with optimizations enabled. Here is a repro:

/* test2.cpp */
typedef unsigned char uchar;
typedef uchar __attribute__((ext_vector_type(8))) uchar8;

uchar8 foo() {
  volatile uchar8 P  = {112, 152, 64, 187, 255, 57, 56, 139};
  uchar8 R  = {1, 119, 73, 145, 253, 118, 32, 31};
  return P % R;
}

And compiled on linux using "clang -c -O2 test2.cpp":

clang-8:
/home/dyung/src/upstream/llvm_clean/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1187:
llvm::SDValue llvm::SelectionDAG::getConstant(uint64_t, const llvm::SDLoc &,
llvm::EVT, bool,
bool): Assertion `(EltVT.getSizeInBits() >= 64 || (uint64_t)((int64_t)Val >>
EltVT.getSizeInBits())
+ 1 < 2) && "getConstant with a uint64_t value that doesn't fit in the type!"'
failed.
Stack dump:
0.    Program arguments: /home/dyung/src/upstream/339121-linux/bin/clang-8 -cc1
-triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name test2.cpp
-mrelocation-model
static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables
-fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb
-momit-leaf-frame-pointer -coverage-notes-file
/home/dyung/sandbox/random_intrinsics/test2.gcno
-resource-dir /home/dyung/src/upstream/339121-linux/lib/clang/8.0.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.5.0/../../../../include/c++/5.5.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.5.0/../../../../include/x86_64-linux-gnu/c++/5.5.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.5.0/../../../../include/x86_64-linux-gnu/c++/5.5.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.5.0/../../../../include/c++/5.5.0/backward
-internal-isystem /usr/local/include -internal-isystem
/home/dyung/src/upstream/339121-linux/lib/clang/8.0.0/include
-internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem
/usr/include -O2 -fdeprecated-macro -fdebug-compilation-dir
/home/dyung/sandbox/random_intrinsics
-ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions
-fdiagnostics-show-option -vectorize-loops -vectorize-slp -o test2.o -x c++
test2.cpp -faddrsig 
1.    <eof> parser at end of file
2.    Code generation
3.    Running pass 'Function Pass Manager' on module 'test2.cpp'.
4.    Running pass 'X86 DAG->DAG Instruction Selection' on function '@_Z3foov'
#0 0x00000000020b4c94 PrintStackTraceSignalHandler(void*)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x20b4c94)
#1 0x00000000020b2b3e llvm::sys::RunSignalHandlers()
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x20b2b3e)
#2 0x00000000020b4e52 SignalHandler(int)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x20b4e52)
#3 0x00007fe2b2dc2330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007fe2b1bbac37 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x36c37)
#5 0x00007fe2b1bbe028 abort (/lib/x86_64-linux-gnu/libc.so.6+0x3a028)
#6 0x00007fe2b1bb3bf6 (/lib/x86_64-linux-gnu/libc.so.6+0x2fbf6)
#7 0x00007fe2b1bb3ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x00000000029bed2e llvm::SelectionDAG::getConstant(unsigned long,
llvm::SDLoc const&, llvm::EVT,
bool, bool) (/home/dyung/src/upstream/339121-linux/bin/clang-8+0x29bed2e)
#9 0x0000000002a33de1 llvm::TargetLowering::BuildUDIV(llvm::SDNode*,
llvm::SelectionDAG&, bool,
llvm::SmallVectorImpl<llvm::SDNode*>&) const
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x2a33de1)
#10 0x00000000028faca0 (anonymous
namespace)::DAGCombiner::visitUDIVLike(llvm::SDValue,
llvm::SDValue, llvm::SDNode*)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x28faca0)
#11 0x00000000028ba75f (anonymous namespace)::DAGCombiner::visit(llvm::SDNode*)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x28ba75f)
#12 0x00000000028a48dc (anonymous
namespace)::DAGCombiner::combine(llvm::SDNode*)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x28a48dc)
#13 0x00000000028a36f4 llvm::SelectionDAG::Combine(llvm::CombineLevel,
llvm::AAResults*,
llvm::CodeGenOpt::Level)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x28a36f4)
#14 0x00000000029ff4ad llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x29ff4ad)
#15 0x00000000029fd386
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x29fd386)
#16 0x00000000029f919f
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x29f919f)
#17 0x0000000001335641 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x1335641)
#18 0x000000000180fe18
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x180fe18)
#19 0x0000000001b6d0bc llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x1b6d0bc)
#20 0x0000000001b6d343 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x1b6d343)
#21 0x0000000001b6d960 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x1b6d960)
#22 0x000000000228ee9c 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> >)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x228ee9c)
#23 0x0000000002acd7b5
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x2acd7b5)
#24 0x00000000032c9ba5 clang::ParseAST(clang::Sema&, bool, bool)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x32c9ba5)
#25 0x0000000002748b30 clang::FrontendAction::Execute()
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x2748b30)
#26 0x00000000026f1401
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x26f1401)
#27 0x00000000027ec3d9
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x27ec3d9)
#28 0x00000000008eb8eb cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x8eb8eb)
#29 0x00000000008e913a main
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x8e913a)
#30 0x00007fe2b1ba5f45 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21f45)
#31 0x00000000008e60ad _start
(/home/dyung/src/upstream/339121-linux/bin/clang-8+0x8e60ad)
clang-8: error: unable to execute command: Aborted (core dumped)
clang-8: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 8.0.0 (trunk 339121)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/dyung/src/upstream/339121-linux/bin
clang-8: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the
crash backtrace, preprocessed source, and associated run script.
clang-8: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-8: note: diagnostic msg: /tmp/test2-2ebf58.cpp
clang-8: note: diagnostic msg: /tmp/test2-2ebf58.sh
clang-8: 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/20180808/b102e623/attachment.html>


More information about the llvm-bugs mailing list