[llvm-bugs] [Bug 36431] New: 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.

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 19 00:00:54 PST 2018


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

            Bug ID: 36431
           Summary: 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.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: shlei930 at gmail.com
                CC: llvm-bugs at lists.llvm.org

$clang-trunk -v
clang version 7.0.0 (trunk 325390)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin

$ clang-trunk -m32 -O3 abc.c
clang-7.0:
/home/suhua/compilers/trunk/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1106:
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.
#0 0x0000000002313b1a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2313b1a)
#1 0x0000000002311b8e llvm::sys::RunSignalHandlers()
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2311b8e)
#2 0x0000000002311cf2 SignalHandler(int)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2311cf2)
#3 0x00007f90af5d6390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007f90ae341428 gsignal
/build/glibc-Cl5G7W/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007f90ae34302a abort /build/glibc-Cl5G7W/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007f90ae339bd7 __assert_fail_base
/build/glibc-Cl5G7W/glibc-2.23/assert/assert.c:92:0
#7 0x00007f90ae339c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x0000000002c0d668
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2c0d668)
#9 0x0000000002bc84ad llvm::SelectionDAGBuilder::visitGetElementPtr(llvm::User
const&) (/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2bc84ad)
#10 0x0000000002be7c2d llvm::SelectionDAGBuilder::visit(llvm::Instruction
const&) (/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2be7c2d)
#11 0x0000000002c3140d
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&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2c3140d)
#12 0x0000000002c35049
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2c35049)
#13 0x0000000002c36b3e
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) [clone
.part.1077] (/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2c36b3e)
#14 0x00000000016fd094 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x16fd094)
#15 0x0000000001b5cd85
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x1b5cd85)
#16 0x0000000001e80f03 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x1e80f03)
#17 0x0000000001e80fac llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x1e80fac)
#18 0x0000000001e8184f llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x1e8184f)
#19 0x00000000024b7cc6 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24b7cc6)
#20 0x00000000024b8fdf 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/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24b8fdf)
#21 0x0000000002cf57bb
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2cf57bb)
#22 0x0000000002f20022 clang::ParseAST(clang::Sema&, bool, bool)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2f20022)
#23 0x0000000002cf4dff clang::CodeGenAction::ExecuteAction()
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2cf4dff)
#24 0x0000000002888b96 clang::FrontendAction::Execute()
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2888b96)
#25 0x000000000285dede
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x285dede)
#26 0x000000000291d1c2
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x291d1c2)
#27 0x0000000000c8c108 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0xc8c108)
#28 0x0000000000c103a1 main
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0xc103a1)
#29 0x00007f90ae32c830 __libc_start_main
/build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:325:0
#30 0x0000000000c86db9 _start
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0xc86db9)
Stack dump:
0.      Program arguments: /home/suhua/compilers/trunk/root-clang/bin/clang-7.0
-cc1 -triple i386-unknown-linux-gnu -emit-obj -disable-free -main-file-name
abc.c -mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -fuse-init-array -target-cpu pentium4 -dwarf-column-info
-debugger-tuning=gdb -momit-leaf-frame-pointer -coverage-notes-file
/home/suhua/Documents/VPT/reduce/bug4/abc.gcno -resource-dir
/home/suhua/compilers/trunk/root-clang/lib/clang/7.0.0 -c-isystem . -c-isystem
/usr/local/include/csmith-2.3.0/ -c-isystem
/home/suhua/media_disk/home/klee/include/klee -internal-isystem
/usr/local/include -internal-isystem
/home/suhua/compilers/trunk/root-clang/lib/clang/7.0.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-fdebug-compilation-dir /home/suhua/Documents/VPT/reduce/bug4 -ferror-limit 19
-fmessage-length 204 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -o abc.o -x c abc.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'abc.c'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@fn1'
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 325390)
Target: i386-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-7.0: 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-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/abc-d585b2.c
clang-7.0: note: diagnostic msg: /tmp/abc-d585b2.sh
clang-7.0: note: diagnostic msg:

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

$ cat abc.c
struct A {
  unsigned b;
};
struct {
  char c[2000000000];
  char d[3000000000];
  struct A e;
} * a;
void fn1() { a->e.b = 3; }

-- 
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/20180219/ff3d717f/attachment.html>


More information about the llvm-bugs mailing list