[PATCH] D126903: [clang] Add support for __builtin_memset_inline
Alexandre Ganea via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 25 16:52:07 PDT 2022
aganea added a comment.
Hello @gchatelet! This patches introduces a regression in a two-stage build using rpmalloc on Windows. Bisection lead me here. Would you have a chance to take a look please? Thanks in advance.
To reproduce, I used the following script (rename to make_llvm.bat) F25053901: make_llvm.txt <https://reviews.llvm.org/F25053901>
C:\git\llvm-project>make_llvm.bat stage1
...
C:\git\llvm-project>ninja clang lld -C stage1
...
C:\git\llvm-project>make_llvm.bat stage2_rpmalloc
...
C:\git\llvm-project>ninja lld -C stage2_rpmalloc
generates:
[158/2714] Building C object lib\Support\CMakeFiles\LLVMSupport.dir\C_\git\rpmalloc\rpmalloc\rpmalloc.c.obj
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/C_/git/rpmalloc/rpmalloc/rpmalloc.c.obj
C:\git\llvm-project\stage1\bin\clang-cl.exe /nologo -DENABLE_OVERRIDE -DENABLE_PRELOAD -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IC:\git\llvm-project\stage2_rpmalloc\lib\Support -IC:\git\llvm-project\llvm\lib\Support -IC:\git\llvm-project\stage2_rpmalloc\include -IC:\git\llvm-project\llvm\include /GS- /D_ITERATOR_DEBUG_LEVEL=0 -Xclang -O3 -fstrict-aliasing -march=native -flto=thin -fwhole-program-vtables -fuse-ld=lld /Zc:inline /Zi -gcodeview-ghash /Zc:strictStrings /Oi /W4 -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wstring-conversion -Wmisleading-indentation /Gw -flto=thin /MT /O2 /Ob2 /DNDEBUG /showIncludes /Folib\Support\CMakeFiles\LLVMSupport.dir\C_\git\rpmalloc\rpmalloc\rpmalloc.c.obj /Fdlib\Support\CMakeFiles\LLVMSupport.dir\LLVMSupport.pdb -c -- C:\git\rpmalloc\rpmalloc\rpmalloc.c
Assertion failed: isa<To>(Val) && "cast<Ty>() argument of incompatible type!", file C:/git/llvm-project/llvm/include\llvm/Support/Casting.h, line 578
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: C:\\git\\llvm-project\\stage1\\bin\\clang-cl.exe /nologo -DENABLE_OVERRIDE -DENABLE_PRELOAD -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IC:\\git\\llvm-project\\stage2_rpmalloc\\lib\\Support -IC:\\git\\llvm-project\\llvm\\lib\\Support -IC:\\git\\llvm-project\\stage2_rpmalloc\\include -IC:\\git\\llvm-project\\llvm\\include /GS- /D_ITERATOR_DEBUG_LEVEL=0 -Xclang -O3 -fstrict-aliasing -march=native -flto=thin -fwhole-program-vtables -fuse-ld=lld /Zc:inline /Zi -gcodeview-ghash /Zc:strictStrings /Oi /W4 -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wstring-conversion -Wmisleading-indentation /Gw -flto=thin /MT /O2 /Ob2 /DNDEBUG /showIncludes /Folib\\Support\\CMakeFiles\\LLVMSupport.dir\\C_\\git\\rpmalloc\\rpmalloc\\rpmalloc.c.obj /Fdlib\\Support\\CMakeFiles\\LLVMSupport.dir\\LLVMSupport.pdb -c -- C:\\git\\rpmalloc\\rpmalloc\\rpmalloc.c
1. <eof> parser at end of file
2. Optimizer
#0 0x00007ff7f877ca86 HandleAbort C:\git\llvm-project\llvm\lib\Support\Windows\Signals.inc:418:0
#1 0x00007ff7fcdfc6bb raise C:\git\llvm-project\stage1\minkernel\crts\ucrt\src\appcrt\misc\signal.cpp:547:0
#2 0x00007ff7fcdf1ff4 abort C:\git\llvm-project\stage1\minkernel\crts\ucrt\src\appcrt\startup\abort.cpp:71:0
#3 0x00007ff7fcdf2672 common_assert_to_stderr<wchar_t> C:\git\llvm-project\stage1\minkernel\crts\ucrt\src\appcrt\startup\assert.cpp:186:0
#4 0x00007ff7fcdf251a _wassert C:\git\llvm-project\stage1\minkernel\crts\ucrt\src\appcrt\startup\assert.cpp:443:0
#5 0x00007ff7f9b48e7b llvm::VNCoercion::analyzeLoadFromClobberingMemInst(class llvm::Type *, class llvm::Value *, class llvm::MemIntrinsic *, class llvm::DataLayout const &) C:\git\llvm-project\llvm\lib\Transforms\Utils\VNCoercion.cpp:381:0
#6 0x00007ff7f85a1ec4 llvm::GVNPass::AnalyzeLoadAvailability(class llvm::LoadInst *, class llvm::MemDepResult, class llvm::Value *, struct llvm::gvn::AvailableValue &) C:\git\llvm-project\llvm\lib\Transforms\Scalar\GVN.cpp:1211:0
#7 0x00007ff7f85a8a5c llvm::GVNPass::processLoad(class llvm::LoadInst *) C:\git\llvm-project\llvm\lib\Transforms\Scalar\GVN.cpp:2068:0
#8 0x00007ff7f85aa465 llvm::GVNPass::processInstruction(class llvm::Instruction *) C:\git\llvm-project\llvm\lib\Transforms\Scalar\GVN.cpp:2483:0
#9 0x00007ff7f85ab3ed llvm::GVNPass::processBlock(class llvm::BasicBlock *) C:\git\llvm-project\llvm\lib\Transforms\Scalar\GVN.cpp:2682:0
#10 0x00007ff7f85aadd0 llvm::GVNPass::iterateOnFunction(class llvm::Function &) C:\git\llvm-project\llvm\lib\Transforms\Scalar\GVN.cpp:3027:0
#11 0x00007ff7f85a099d llvm::GVNPass::runImpl(class llvm::Function &, class llvm::AssumptionCache &, class llvm::DominatorTree &, class llvm::TargetLibraryInfo const &, class llvm::AAResults &, class llvm::MemoryDependenceResults *, class llvm::LoopInfo *, class llvm::OptimizationRemarkEmitter *, class llvm::MemorySSA *) C:\git\llvm-project\llvm\lib\Transforms\Scalar\GVN.cpp:2627:0
#12 0x00007ff7f85a0595 llvm::GVNPass::run(class llvm::Function &, class llvm::AnalysisManager<class llvm::Function> &) C:\git\llvm-project\llvm\lib\Transforms\Scalar\GVN.cpp:732:0
#13 0x00007ff7fb2f5771 llvm::detail::PassModel<class llvm::Function, class llvm::GVNPass, class llvm::PreservedAnalyses, class llvm::AnalysisManager<class llvm::Function>>::run(class llvm::Function &, class llvm::AnalysisManager<class llvm::Function> &) C:\git\llvm-project\llvm\include\llvm\IR\PassManagerInternal.h:88:0
#14 0x00007ff7f8eba44f llvm::PassManager<class llvm::Function, class llvm::AnalysisManager<class llvm::Function>>::run(class llvm::Function &, class llvm::AnalysisManager<class llvm::Function> &) C:\git\llvm-project\llvm\include\llvm\IR\PassManager.h:522:0
#15 0x00007ff7f7faed21 llvm::detail::PassModel<class llvm::Function, class llvm::PassManager<class llvm::Function, class llvm::AnalysisManager<class llvm::Function>>, class llvm::PreservedAnalyses, class llvm::AnalysisManager<class llvm::Function>>::run(class llvm::Function &, class llvm::AnalysisManager<class llvm::Function> &) C:\git\llvm-project\llvm\include\llvm\IR\PassManagerInternal.h:88:0
#16 0x00007ff7f8ec1d7e llvm::CGSCCToFunctionPassAdaptor::run(class llvm::LazyCallGraph::SCC &, class llvm::AnalysisManager<class llvm::LazyCallGraph::SCC, class llvm::LazyCallGraph &> &, class llvm::LazyCallGraph &, struct llvm::CGSCCUpdateResult &) C:\git\llvm-project\llvm\lib\Analysis\CGSCCPassManager.cpp:554:0
#17 0x00007ff7f7fb094d llvm::detail::PassModel<class llvm::LazyCallGraph::SCC, class llvm::CGSCCToFunctionPassAdaptor, class llvm::PreservedAnalyses, class llvm::AnalysisManager<class llvm::LazyCallGraph::SCC, class llvm::LazyCallGraph &>, class llvm::LazyCallGraph &, struct llvm::CGSCCUpdateResult &>::run(class llvm::LazyCallGraph::SCC &, class llvm::AnalysisManager<class llvm::LazyCallGraph::SCC, class llvm::LazyCallGraph &> &, class llvm::LazyCallGraph &, struct llvm::CGSCCUpdateResult &) C:\git\llvm-project\llvm\include\llvm\IR\PassManagerInternal.h:88:0
#18 0x00007ff7f8ebc8c1 llvm::PassManager<class llvm::LazyCallGraph::SCC, class llvm::AnalysisManager<class llvm::LazyCallGraph::SCC, class llvm::LazyCallGraph &>, class llvm::LazyCallGraph &, struct llvm::CGSCCUpdateResult &>::run(class llvm::LazyCallGraph::SCC &, class llvm::AnalysisManager<class llvm::LazyCallGraph::SCC, class llvm::LazyCallGraph &> &, class llvm::LazyCallGraph &, struct llvm::CGSCCUpdateResult &) C:\git\llvm-project\llvm\lib\Analysis\CGSCCPassManager.cpp:90:0
#19 0x00007ff7f989597d llvm::detail::PassModel<class llvm::LazyCallGraph::SCC, class llvm::PassManager<class llvm::LazyCallGraph::SCC, class llvm::AnalysisManager<class llvm::LazyCallGraph::SCC, class llvm::LazyCallGraph &>, class llvm::LazyCallGraph &, struct llvm::CGSCCUpdateResult &>, class llvm::PreservedAnalyses, class llvm::AnalysisManager<class llvm::LazyCallGraph::SCC, class llvm::LazyCallGraph &>, class llvm::LazyCallGraph &, struct llvm::CGSCCUpdateResult &>::run(class llvm::LazyCallGraph::SCC &, class llvm::AnalysisManager<class llvm::LazyCallGraph::SCC, class llvm::LazyCallGraph &> &, class llvm::LazyCallGraph &, struct llvm::CGSCCUpdateResult &) C:\git\llvm-project\llvm\include\llvm\IR\PassManagerInternal.h:88:0
#20 0x00007ff7f8ebffe1 llvm::DevirtSCCRepeatedPass::run(class llvm::LazyCallGraph::SCC &, class llvm::AnalysisManager<class llvm::LazyCallGraph::SCC, class llvm::LazyCallGraph &> &, class llvm::LazyCallGraph &, struct llvm::CGSCCUpdateResult &) C:\git\llvm-project\llvm\lib\Analysis\CGSCCPassManager.cpp:417:0
#21 0x00007ff7f9895e4d llvm::detail::PassModel<class llvm::LazyCallGraph::SCC, class llvm::DevirtSCCRepeatedPass, class llvm::PreservedAnalyses, class llvm::AnalysisManager<class llvm::LazyCallGraph::SCC, class llvm::LazyCallGraph &>, class llvm::LazyCallGraph &, struct llvm::CGSCCUpdateResult &>::run(class llvm::LazyCallGraph::SCC &, class llvm::AnalysisManager<class llvm::LazyCallGraph::SCC, class llvm::LazyCallGraph &> &, class llvm::LazyCallGraph &, struct llvm::CGSCCUpdateResult &) C:\git\llvm-project\llvm\include\llvm\IR\PassManagerInternal.h:88:0
#22 0x00007ff7f8ebeeb0 llvm::ModuleToPostOrderCGSCCPassAdaptor::run(class llvm::Module &, class llvm::AnalysisManager<class llvm::Module> &) C:\git\llvm-project\llvm\lib\Analysis\CGSCCPassManager.cpp:283:0
#23 0x00007ff7f9895b91 llvm::detail::PassModel<class llvm::Module, class llvm::ModuleToPostOrderCGSCCPassAdaptor, class llvm::PreservedAnalyses, class llvm::AnalysisManager<class llvm::Module>>::run(class llvm::Module &, class llvm::AnalysisManager<class llvm::Module> &) C:\git\llvm-project\llvm\include\llvm\IR\PassManagerInternal.h:88:0
#24 0x00007ff7f8eb9744 llvm::PassManager<class llvm::Module, class llvm::AnalysisManager<class llvm::Module>>::run(class llvm::Module &, class llvm::AnalysisManager<class llvm::Module> &) C:\git\llvm-project\llvm\include\llvm\IR\PassManager.h:522:0
#25 0x00007ff7f989504c llvm::ModuleInlinerWrapperPass::run(class llvm::Module &, class llvm::AnalysisManager<class llvm::Module> &) C:\git\llvm-project\llvm\lib\Transforms\IPO\Inliner.cpp:1150:0
#26 0x00007ff7fb2f6621 llvm::detail::PassModel<class llvm::Module, class llvm::ModuleInlinerWrapperPass, class llvm::PreservedAnalyses, class llvm::AnalysisManager<class llvm::Module>>::run(class llvm::Module &, class llvm::AnalysisManager<class llvm::Module> &) C:\git\llvm-project\llvm\include\llvm\IR\PassManagerInternal.h:88:0
#27 0x00007ff7f8eb9744 llvm::PassManager<class llvm::Module, class llvm::AnalysisManager<class llvm::Module>>::run(class llvm::Module &, class llvm::AnalysisManager<class llvm::Module> &) C:\git\llvm-project\llvm\include\llvm\IR\PassManager.h:522:0
#28 0x00007ff7f9cd6282 `anonymous namespace'::EmitAssemblyHelper::RunOptimizationPipeline C:\git\llvm-project\clang\lib\CodeGen\BackendUtil.cpp:965:0
#29 0x00007ff7f9cce34e clang::EmitBackendOutput(class clang::DiagnosticsEngine &, class clang::HeaderSearchOptions const &, class clang::CodeGenOptions const &, class clang::TargetOptions const &, class clang::LangOptions const &, class llvm::StringRef, class llvm::Module *, enum clang::BackendAction, class std::unique_ptr<class llvm::raw_pwrite_stream, struct std::default_delete<class llvm::raw_pwrite_stream>>) C:\git\llvm-project\clang\lib\CodeGen\BackendUtil.cpp:1181:0
#30 0x00007ff7fa0b26ae clang::BackendConsumer::HandleTranslationUnit(class clang::ASTContext &) C:\git\llvm-project\clang\lib\CodeGen\CodeGenAction.cpp:379:0
#31 0x00007ff7fbaf08e4 clang::ParseAST(class clang::Sema &, bool, bool) C:\git\llvm-project\clang\lib\Parse\ParseAST.cpp:182:0
#32 0x00007ff7fa017775 clang::FrontendAction::Execute(void) C:\git\llvm-project\clang\lib\Frontend\FrontendAction.cpp:1032:0
#33 0x00007ff7f88eca63 clang::CompilerInstance::ExecuteAction(class clang::FrontendAction &) C:\git\llvm-project\clang\lib\Frontend\CompilerInstance.cpp:1033:0
#34 0x00007ff7f8989667 clang::ExecuteCompilerInvocation(class clang::CompilerInstance *) C:\git\llvm-project\clang\lib\FrontendTool\ExecuteCompilerInvocation.cpp:266:0
#35 0x00007ff7f7f184c9 cc1_main(class llvm::ArrayRef<char const *>, char const *, void *) C:\git\llvm-project\clang\tools\driver\cc1_main.cpp:248:0
#36 0x00007ff7f7f14fc3 ExecuteCC1Tool C:\git\llvm-project\clang\tools\driver\driver.cpp:317:0
#37 0x00007ff7f9dd7236 llvm::function_ref<void ()>::callback_fn<`lambda at C:/git/llvm-project/clang/lib/Driver/Job.cpp:407:22'> C:\git\llvm-project\llvm\include\llvm\ADT\STLFunctionalExtras.h:45:0
#38 0x00007ff7f873317e llvm::CrashRecoveryContext::RunSafely(class llvm::function_ref<(void)>) C:\git\llvm-project\llvm\lib\Support\CrashRecoveryContext.cpp:234:0
#39 0x00007ff7f9dd6eed clang::driver::CC1Command::Execute(class llvm::ArrayRef<class llvm::Optional<class llvm::StringRef>>, class std::basic_string<char, struct std::char_traits<char>, class std::allocator<char>> *, bool *) const C:\git\llvm-project\clang\lib\Driver\Job.cpp:407:0
#40 0x00007ff7f88a9d3a clang::driver::Compilation::ExecuteCommand(class clang::driver::Command const &, class clang::driver::Command const *&) const C:\git\llvm-project\clang\lib\Driver\Compilation.cpp:196:0
#41 0x00007ff7f88aa20a clang::driver::Compilation::ExecuteJobs(class clang::driver::JobList const &, class llvm::SmallVectorImpl<struct std::pair<int, class clang::driver::Command const *>> &) const C:\git\llvm-project\clang\lib\Driver\Compilation.cpp:249:0
#42 0x00007ff7f88c3107 clang::driver::Driver::ExecuteCompilation(class clang::driver::Compilation &, class llvm::SmallVectorImpl<struct std::pair<int, class clang::driver::Command const *>> &) C:\git\llvm-project\clang\lib\Driver\Driver.cpp:1709:0
#43 0x00007ff7f7f148b1 clang_main(int, char **) C:\git\llvm-project\clang\tools\driver\driver.cpp:513:0
#44 0x00007ff7fcdde008 __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0
#45 0x00007ff8f4944ed0 (C:\Windows\System32\KERNEL32.DLL+0x14ed0)
#46 0x00007ff8f529e40b (C:\Windows\SYSTEM32\ntdll.dll+0x7e40b)
clang-cl: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 15.0.0 (https://github.com/llvm/llvm-project.git 38637ee477541370a90b37f149069d8e5c0c2efd)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\git\llvm-project\stage1\bin
clang-cl: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-cl: note: diagnostic msg: C:\Users\aganea\AppData\Local\Temp\2\rpmalloc-70541f.c
clang-cl: note: diagnostic msg: C:\Users\aganea\AppData\Local\Temp\2\rpmalloc-70541f.sh
clang-cl: note: diagnostic msg:
********************
The reproducer: F25054211: rpmalloc-70541f.zip <https://reviews.llvm.org/F25054211>
Using rpmalloc at this revision: https://github.com/mjansson/rpmalloc/commit/f56e2f6794eab5c280b089c90750c681679fde92
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126903/new/
https://reviews.llvm.org/D126903
More information about the cfe-commits
mailing list