OpenMP creates a variable array type with a a null size-expr. The Debug generation failed to due to this. This patch corrects the openmp implementation, updates the tests, and adds a new one for this condition.
Details
- Reviewers
dblaikie majnemer ABataev cfe-commits - Commits
- rG5cb5303b16ec: Merging r284110: --------------------------------------------------------------…
rG2f5ed342797d: Fix for PR30639: CGDebugInfo Null dereference with OpenMP array access, by…
rC284110: Fix for PR30639: CGDebugInfo Null dereference with OpenMP array
rL284110: Fix for PR30639: CGDebugInfo Null dereference with OpenMP array
Diff Detail
- Repository
- rL LLVM
Event Timeline
I think the fix is not quite correct. I believe it's better to replace a call of getVariableArrayDecayedType() in CGStmtOpenMP.cpp by a call to getCanonicalParamType(). Try to replace it and check the result.
Andrey-
It seems that getVariableArrayDecayedType and getCanonicalParamType return the same type in this case (at least in the reproduction). I could definitely change the call, though the changes to CGDebugInfo.cpp are apparently also necessary even in that case.
Is there additional logic that should happen in CGStmtOpenMP that I'm missing?
Emailed with Alexey who identified the problem in the OpenMP implementation that was resulting in incomplete array types being emitted, which broke an assumption in the new CGDebugInfo code.
Fixed Alexey's nit. Will need someone else to commit this, I don't yet have commit access.