[PATCH] D63733: [IndVars] Use exit count reasoning to discharge obviously untaken exits
Matt Morehouse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 16 09:57:19 PDT 2019
morehouse added a comment.
The assertion `assert(!ExitCount->isZero() && "Should have been folded above");` is failing during the unittest build on the UBSan bot: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/13940
FAILED: unittests/Support/CMakeFiles/SupportTests.dir/LEB128Test.cpp.o
/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_LANG_CXX11=1 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iunittests/Support -I/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm/unittests/Support -I/usr/include/libxml2 -Iinclude -I/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm/include -I/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm/utils/unittest/googletest/include -I/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm/utils/unittest/googlemock/include -fsanitize=undefined -w -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-class-memaccess -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fno-omit-frame-pointer -gline-tables-only -fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all -fsanitize-blacklist=/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm/utils/sanitizers/ubsan_blacklist.txt -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -UNDEBUG -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -fno-rtti -MD -MT unittests/Support/CMakeFiles/SupportTests.dir/LEB128Test.cpp.o -MF unittests/Support/CMakeFiles/SupportTests.dir/LEB128Test.cpp.o.d -o unittests/Support/CMakeFiles/SupportTests.dir/LEB128Test.cpp.o -c /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm/unittests/Support/LEB128Test.cpp
clang-9: /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:2813: bool {anonymous}::IndVarSimplify::run(llvm::Loop*): Assertion `!ExitCount->isZero() && "Should have been folded above"' failed.
Stack dump:
0. Program arguments: /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name LEB128Test.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=line-tables-only -dwarf-version=4 -debugger-tuning=gdb -ffunction-sections -fdata-sections -coverage-notes-file /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/unittests/Support/CMakeFiles/SupportTests.dir/LEB128Test.cpp.gcno -resource-dir /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/lib/clang/9.0.0 -dependency-file unittests/Support/CMakeFiles/SupportTests.dir/LEB128Test.cpp.o.d -sys-header-deps -MT unittests/Support/CMakeFiles/SupportTests.dir/LEB128Test.cpp.o -D GTEST_HAS_RTTI=0 -D GTEST_HAS_TR1_TUPLE=0 -D GTEST_LANG_CXX11=1 -D _DEBUG -D _GNU_SOURCE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -I unittests/Support -I /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm/unittests/Support -I /usr/include/libxml2 -I include -I /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm/include -I /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm/utils/unittest/googletest/include -I /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm/utils/unittest/googlemock/include -U NDEBUG -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/x86_64-linux-gnu/c++/6.3.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/x86_64-linux-gnu/c++/6.3.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/backward -internal-isystem /usr/local/include -internal-isystem /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/lib/clang/9.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-class-memaccess -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -pedantic -w -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan -ferror-limit 19 -fmessage-length 0 -fvisibility-inlines-hidden -fsanitize=alignment,array-bounds,bool,builtin,enum,float-cast-overflow,integer-divide-by-zero,nonnull-attribute,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,unreachable,vla-bound -fsanitize-blacklist=/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm/utils/sanitizers/ubsan_blacklist.txt -fdepfile-entry=/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm/utils/sanitizers/ubsan_blacklist.txt -fno-rtti -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -o unittests/Support/CMakeFiles/SupportTests.dir/LEB128Test.cpp.o -x c++ /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm/unittests/Support/LEB128Test.cpp
1. <eof> parser at end of file
2. Per-module optimization passes
3. Running pass 'CallGraph Pass Manager' on module '/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm/unittests/Support/LEB128Test.cpp'.
4. Running pass 'Loop Pass Manager' on function '@_ZN12_GLOBAL__N_129LEB128Test_DecodeULEB128_Test8TestBodyEv'
5. Running pass 'Induction Variable Simplification' on basic block '%do.body.i1427'
#0 0x000056385b4fbb9a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x2b1cb9a)
#1 0x000056385b4f9925 llvm::sys::RunSignalHandlers() (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x2b1a925)
#2 0x000056385b4f9a3c SignalHandler(int) (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x2b1aa3c)
#3 0x00007f3bda1a10e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x110e0)
#4 0x00007f3bd8f60fff raise (/lib/x86_64-linux-gnu/libc.so.6+0x32fff)
#5 0x00007f3bd8f6242a abort (/lib/x86_64-linux-gnu/libc.so.6+0x3442a)
#6 0x00007f3bd8f59e67 (/lib/x86_64-linux-gnu/libc.so.6+0x2be67)
#7 0x00007f3bd8f59f12 (/lib/x86_64-linux-gnu/libc.so.6+0x2bf12)
#8 0x000056385b2ede4d (anonymous namespace)::IndVarSimplify::run(llvm::Loop*) (.part.484) (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x290ee4d)
#9 0x000056385b2ee9bf (anonymous namespace)::IndVarSimplifyLegacyPass::runOnLoop(llvm::Loop*, llvm::LPPassManager&) (.part.485) (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x290f9bf)
#10 0x000056385a986f13 llvm::LPPassManager::runOnFunction(llvm::Function&) (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x1fa7f13)
#11 0x000056385af4c010 llvm::FPPassManager::runOnFunction(llvm::Function&) (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x256d010)
#12 0x000056385a8e16c5 (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x1f026c5)
#13 0x000056385af4cd54 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x256dd54)
#14 0x000056385b6f9a29 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x2d1aa29)
#15 0x000056385b6fb358 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> >) (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x2d1c358)
#16 0x000056385c106cfa clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x3727cfa)
#17 0x000056385c99aac9 clang::ParseAST(clang::Sema&, bool, bool) (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x3fbbac9)
#18 0x000056385c104729 clang::CodeGenAction::ExecuteAction() (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x3725729)
#19 0x000056385bba1e41 clang::FrontendAction::Execute() (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x31c2e41)
#20 0x000056385bb68c60 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x3189c60)
#21 0x000056385bc48482 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0x3269482)
#22 0x0000563859933986 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0xf54986)
#23 0x00005638598a820d main (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0xec920d)
#24 0x00007f3bd8f4e2e1 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e1)
#25 0x000056385992fb4a _start (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build0/bin/clang-9+0xf50b4a)
Could someone please take a look?
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63733/new/
https://reviews.llvm.org/D63733
More information about the llvm-commits
mailing list