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

            Bug ID: 36585
           Summary: Assertion `Base && "base expression should not be
                    empty"' failed
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangb...@nondot.org
          Reporter: shlei...@gmail.com
                CC: llvm-bugs@lists.llvm.org

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

$ clang-trunk abc.c
clang-7.0:
/home/suhua/compilers/trunk/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp:1062:
bool {anonymous}::ConstStructBuilder::Build({anonymous}::ConstExprEmitter*,
llvm::ConstantStruct*, clang::InitListExpr*): Assertion `Base && "base
expression should not be empty"' failed.
#0 0x00000000023281ca llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x23281ca)
#1 0x000000000232623e llvm::sys::RunSignalHandlers()
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x232623e)
#2 0x00000000023263a2 SignalHandler(int)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x23263a2)
#3 0x00007f68a4449390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007f68a31b4428 gsignal
/build/glibc-Cl5G7W/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007f68a31b602a abort /build/glibc-Cl5G7W/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007f68a31acbd7 __assert_fail_base
/build/glibc-Cl5G7W/glibc-2.23/assert/assert.c:92:0
#7 0x00007f68a31acc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x00000000024f4ec9 (anonymous
namespace)::ConstExprEmitter::EmitDesignatedInitUpdater(llvm::Constant*,
clang::InitListExpr*, clang::QualType)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24f4ec9)
#9 0x00000000024f5ae7 clang::StmtVisitorBase<clang::make_ptr, (anonymous
namespace)::ConstExprEmitter, llvm::Constant*,
clang::QualType>::Visit(clang::Stmt*, clang::QualType)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24f5ae7)
#10 0x00000000024f3f5d
clang::CodeGen::ConstantEmitter::tryEmitPrivate(clang::Expr const*,
clang::QualType)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24f3f5d)
#11 0x00000000024f4146
clang::CodeGen::ConstantEmitter::tryEmitPrivateForMemory(clang::Expr const*,
clang::QualType)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24f4146)
#12 0x00000000024f5d8e clang::StmtVisitorBase<clang::make_ptr, (anonymous
namespace)::ConstExprEmitter, llvm::Constant*,
clang::QualType>::Visit(clang::Stmt*, clang::QualType)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24f5d8e)
#13 0x00000000024f3f5d
clang::CodeGen::ConstantEmitter::tryEmitPrivate(clang::Expr const*,
clang::QualType)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24f3f5d)
#14 0x00000000024f4146
clang::CodeGen::ConstantEmitter::tryEmitPrivateForMemory(clang::Expr const*,
clang::QualType)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24f4146)
#15 0x00000000024f44c6 (anonymous
namespace)::ConstStructBuilder::BuildStruct(clang::CodeGen::ConstantEmitter&,
clang::InitListExpr*, clang::QualType)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24f44c6)
#16 0x00000000024f5b61 clang::StmtVisitorBase<clang::make_ptr, (anonymous
namespace)::ConstExprEmitter, llvm::Constant*,
clang::QualType>::Visit(clang::Stmt*, clang::QualType)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24f5b61)
#17 0x00000000024f3f5d
clang::CodeGen::ConstantEmitter::tryEmitPrivate(clang::Expr const*,
clang::QualType)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24f3f5d)
#18 0x00000000024f4146
clang::CodeGen::ConstantEmitter::tryEmitPrivateForMemory(clang::Expr const*,
clang::QualType)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24f4146)
#19 0x00000000024f5d8e clang::StmtVisitorBase<clang::make_ptr, (anonymous
namespace)::ConstExprEmitter, llvm::Constant*,
clang::QualType>::Visit(clang::Stmt*, clang::QualType)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24f5d8e)
#20 0x00000000024f64a6
clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit(clang::VarDecl
const&) (/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24f64a6)
#21 0x00000000024f6768
clang::CodeGen::ConstantEmitter::tryEmitForInitializer(clang::VarDecl const&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x24f6768)
#22 0x0000000002574b8d
clang::CodeGen::CodeGenModule::EmitGlobalVarDefinition(clang::VarDecl const*,
bool) (/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2574b8d)
#23 0x000000000258cb71
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x258cb71)
#24 0x000000000258dd70
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x258dd70)
#25 0x000000000258e333
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) [clone
.part.6559] (/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x258e333)
#26 0x0000000002d1b643 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2d1b643)
#27 0x0000000002d157ad
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2d157ad)
#28 0x00000000032121c6 clang::ParseAST(clang::Sema&, bool, bool)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x32121c6)
#29 0x0000000002d1976f clang::CodeGenAction::ExecuteAction()
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2d1976f)
#30 0x00000000028ae056 clang::FrontendAction::Execute()
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x28ae056)
#31 0x00000000028834be
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x28834be)
#32 0x00000000029414ae
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x29414ae)
#33 0x0000000000c94788 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0xc94788)
#34 0x0000000000c18791 main
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0xc18791)
#35 0x00007f68a319f830 __libc_start_main
/build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:325:0
#36 0x0000000000c8f439 _start
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0xc8f439)
Stack dump:
0.      Program arguments: /home/suhua/compilers/trunk/root-clang/bin/clang-7.0
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name abc.c -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -fno-escaping-block-tail-calls -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -debugger-tuning=gdb -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 /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir /home/suhua/Documents/VPT/reduce/bug19 -ferror-limit 19
-fmessage-length 144 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/abc-80e295.o -x c abc.c
1.      <eof> parser at end of file
2.      abc.c:4:1: LLVM IR generation of declaration '(anonymous)'
3.      abc.c:6:3: Generating code for declaration 'o'
clang-7.0: error: unable to execute command: Aborted
clang-7.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.0 (trunk 326568)
Target: x86_64-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-d6b81b.c
clang-7.0: note: diagnostic msg: /tmp/abc-d6b81b.sh
clang-7.0: note: diagnostic msg:

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

$ cat abc.c
struct I {
  int K;
};
struct {
  struct I O[12];
} o[] = {[0 ... 8].O = {}, [3].O[7].K = 8};

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to