[llvm-bugs] [Bug 42488] New: Assertion failure in Instructions.h

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 2 07:45:35 PDT 2019


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

            Bug ID: 42488
           Summary: Assertion failure in Instructions.h
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rcsaba+cfeu at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 22183
  --> https://bugs.llvm.org/attachment.cgi?id=22183&action=edit
Original source and reproducers

$ clang++-99 -std=c++11 -fPIC -g -Wall -pedantic -Wextra -Wformat=2 -Wshadow
-Werror -Wmissing-include-dirs -Wuninitialized -Wfloat-equal -Wcast-align
-Wcast-qual -Wwrite-strings -Wno-error=pragmas -O0 -Wno-self-assign
-fstrict-aliasing    -c -o norm.o norm.cpp
clang-9: /home/csabaraduly/wk/LLVM-git/llvm/include/llvm/IR/Instructions.h:868:
llvm::Type* llvm::checkGEPType(llvm::Type*): Assertion `Ty && "Invalid
GetElementPtrInst indices for type!"' failed.
Stack dump:
0.      Program arguments: /usr/local/bin/clang-9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
norm.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb
-coverage-notes-file /tmp/norm.gcno -resource-dir /usr/local/lib/clang/9.0.0
-isystem /usr/include/c++/8 -isystem /usr/include/x86_64-linux-gnu/c++/8
-internal-isystem
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/10.0.0/../../../../include/c++
-internal-isystem
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/10.0.0/../../../../include/c++/x86_64-pc-linux-gnu
-internal-isystem
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/10.0.0/../../../../include/c++/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/local/lib/clang/9.0.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O0 -Wall -Wextra -Wformat=2 -Wshadow
-Werror -Wmissing-include-dirs -Wuninitialized -Wfloat-equal -Wcast-align
-Wcast-qual -Wwrite-strings -Wno-error=pragmas -Wno-self-assign -pedantic
-std=c++11 -fdeprecated-macro -fdebug-compilation-dir /tmp -ferror-limit 19
-fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -faddrsig -o norm.o -x c++
norm.cpp 
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      norm.cpp:5:25: Generating code for declaration 'h2i::operator()'
 #0 0x000055ab425fdfea llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/bin/clang-9+0x1b1efea)
 #1 0x000055ab425fbca4 llvm::sys::RunSignalHandlers()
(/usr/local/bin/clang-9+0x1b1cca4)
 #2 0x000055ab425fbde2 SignalHandler(int) (/usr/local/bin/clang-9+0x1b1cde2)
 #3 0x00007fee1bf18890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #4 0x00007fee1ab78e97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #5 0x00007fee1ab7a801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #6 0x00007fee1ab6a39a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #7 0x00007fee1ab6a412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #8 0x000055ab42a80728
clang::CodeGen::CodeGenFunction::EmitCheckedInBoundsGEP(llvm::Value*,
llvm::ArrayRef<llvm::Value*>, bool, bool, clang::SourceLocation, llvm::Twine
const&) (/usr/local/bin/clang-9+0x1fa1728)
 #9 0x000055ab42a4876f emitArraySubscriptGEP(clang::CodeGen::CodeGenFunction&,
llvm::Value*, llvm::ArrayRef<llvm::Value*>, bool, bool, clang::SourceLocation,
llvm::Twine const&) (/usr/local/bin/clang-9+0x1f6976f)
#10 0x000055ab42a4894b emitArraySubscriptGEP(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::Address, llvm::ArrayRef<llvm::Value*>, clang::QualType, bool,
bool, clang::SourceLocation, llvm::Twine const&)
(/usr/local/bin/clang-9+0x1f6994b)
#11 0x000055ab42a5daad
clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(clang::ArraySubscriptExpr
const*, bool) (/usr/local/bin/clang-9+0x1f7eaad)
#12 0x000055ab42a58e30 clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr
const*) (/usr/local/bin/clang-9+0x1f79e30)
#13 0x000055ab42a5ddee
clang::CodeGen::CodeGenFunction::EmitCheckedLValue(clang::Expr const*,
clang::CodeGen::CodeGenFunction::TypeCheckKind)
(/usr/local/bin/clang-9+0x1f7edee)
#14 0x000055ab42a8c459 (anonymous
namespace)::ScalarExprEmitter::EmitLoadOfLValue(clang::Expr const*)
(/usr/local/bin/clang-9+0x1fad459)
#15 0x000055ab414b6b64 (anonymous
namespace)::ScalarExprEmitter::VisitArraySubscriptExpr(clang::ArraySubscriptExpr*)
(/usr/local/bin/clang-9+0x9d7b64)
#16 0x000055ab42a8ab48 (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*)
(/usr/local/bin/clang-9+0x1fabb48)
#17 0x000055ab414b7690 (anonymous
namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr*)
(/usr/local/bin/clang-9+0x9d8690)
#18 0x000055ab42a8ac8c (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*)
(/usr/local/bin/clang-9+0x1fabc8c)
#19 0x000055ab414b7b7d (anonymous
namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr*)
(/usr/local/bin/clang-9+0x9d8b7d)
#20 0x000055ab42a8ac8c (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*)
(/usr/local/bin/clang-9+0x1fabc8c)
#21 0x000055ab42a8c98c (anonymous
namespace)::ScalarExprEmitter::EmitBinOps(clang::BinaryOperator const*)
(/usr/local/bin/clang-9+0x1fad98c)
#22 0x000055ab42a8a336 (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*)
(/usr/local/bin/clang-9+0x1fab336)
#23 0x000055ab414b7b7d (anonymous
namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr*)
(/usr/local/bin/clang-9+0x9d8b7d)
#24 0x000055ab42a8ac8c (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*)
(/usr/local/bin/clang-9+0x1fabc8c)
#25 0x000055ab42a8bde3
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
(/usr/local/bin/clang-9+0x1facde3)
#26 0x000055ab428681c5
clang::CodeGen::CodeGenFunction::EmitReturnStmt(clang::ReturnStmt const&)
(/usr/local/bin/clang-9+0x1d891c5)
#27 0x000055ab42869c4d clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>) (/usr/local/bin/clang-9+0x1d8ac4d)
#28 0x000055ab42869db3
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) (/usr/local/bin/clang-9+0x1d8adb3)
#29 0x000055ab428a4ca7
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*)
(/usr/local/bin/clang-9+0x1dc5ca7)
#30 0x000055ab428b45dd
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/usr/local/bin/clang-9+0x1dd55dd)
#31 0x000055ab428ec42f
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/local/bin/clang-9+0x1e0d42f)
#32 0x000055ab428e9cdd
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/local/bin/clang-9+0x1e0acdd)
#33 0x000055ab428f0b4e clang::CodeGen::CodeGenModule::EmitDeferred()
(/usr/local/bin/clang-9+0x1e11b4e)
#34 0x000055ab428f0d18 clang::CodeGen::CodeGenModule::Release()
(/usr/local/bin/clang-9+0x1e11d18)
#35 0x000055ab43258607 (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/bin/clang-9+0x2779607)
#36 0x000055ab43257265
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/bin/clang-9+0x2778265)
#37 0x000055ab43bd0539 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/bin/clang-9+0x30f1539)
#38 0x000055ab43254c98 clang::CodeGenAction::ExecuteAction()
(/usr/local/bin/clang-9+0x2775c98)
#39 0x000055ab42cd7b19 clang::FrontendAction::Execute()
(/usr/local/bin/clang-9+0x21f8b19)
#40 0x000055ab42c9be31
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/bin/clang-9+0x21bce31)
#41 0x000055ab42d8319f
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/bin/clang-9+0x22a419f)
#42 0x000055ab41706caf cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/bin/clang-9+0xc27caf)
#43 0x000055ab416ab9a9 main (/usr/local/bin/clang-9+0xbcc9a9)
#44 0x00007fee1ab5bb97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#45 0x000055ab4170241a _start (/usr/local/bin/clang-9+0xc2341a)
clang-9: error: unable to execute command: Aborted (core dumped)
clang-9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 9.0.0 (https://github.com/llvm/llvm-project.git
97147853ad3bc4083d2026265296609df596c160)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-9: 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-9: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-9: note: diagnostic msg: /tmp/norm-5dbb08.cpp
clang-9: note: diagnostic msg: /tmp/norm-5dbb08.sh
clang-9: note: diagnostic msg: 

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

$ clang++-99 -v 
clang version 9.0.0 (https://github.com/llvm/llvm-project.git
97147853ad3bc4083d2026265296609df596c160)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/10.0.0
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/6.3.0
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/9.0.0
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/9.0.1
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/9.1.0
Selected GCC installation: /usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/10.0.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
clang-9: warning: argument unused during compilation: '-isystem
/usr/include/c++/8' [-Wunused-command-line-argument]
clang-9: warning: argument unused during compilation: '-isystem
/usr/include/x86_64-linux-gnu/c++/8' [-Wunused-command-line-argument]

-- 
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/20190702/c3118155/attachment.html>


More information about the llvm-bugs mailing list