Closed ailiop closed 11 months ago
I think I've encountered this issue before. If you have a source-build of OpenCilk around, can you please check if the following patch resolves the issue?
diff --git a/llvm/lib/Transforms/Instrumentation/ComprehensiveStaticInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/ComprehensiveStaticInstrumentation.cpp
index 9e0828dbb968..f847eed6f1fa 100644
--- a/llvm/lib/Transforms/Instrumentation/ComprehensiveStaticInstrumentation.cpp
+++ b/llvm/lib/Transforms/Instrumentation/ComprehensiveStaticInstrumentation.cpp
@@ -2002,7 +2002,7 @@ CallInst *CSIImpl::createRTUnitInitCall(IRBuilder<> &IRB) {
// Insert call to __csirt_unit_init
return IRB.CreateCall(
RTUnitInit,
- {IRB.CreateGlobalStringPtr(M.getName()),
+ {IRB.CreateGlobalStringPtr(M.getName(), "__csi_module_name"),
ConstantExpr::getGetElementPtr(FEDGV->getValueType(), FEDGV, GepArgs),
ConstantExpr::getGetElementPtr(SizeGV->getValueType(), SizeGV, GepArgs),
InitCallsiteToFunction});
I just noticed the other day I had this change in a local copy of OpenCilk but had not pushed it yet.
Thank you, that seems to fix the issue, indeed! I will let you know if I run into subsequent problems but I do not expect any.
Thanks for the confirmation. I'll work on pushing that change.
Describe the bug
The compiler crashes when compiling a C/C++ code with
-fcsi -flto -O1
(or higher optimization level).Expected behavior
No crash.
OpenCilk version
Built from source:
opencilk-project
:opencilk/v2.0.1
cheetah
:opencilk/v2.0.1
productivity-tools
:opencilk/v2.0.1
infrastructure
:opencilk/v2.0.1
System information
Working example code
Steps to reproduce (include relevant output)
(Attached: hello-04ea94.zip, which contains the crash diagnostic files produced by clang.)
Additional comments
This issue does not arise with optimization level
-O0
. It also does not arise with OpenCilk 1.0 at any optimization level.