This is an archive of the discontinued LLVM Phabricator instance.

Fix for Bug 30639: CGDebugInfo Null dereference with OpenMP array access
ClosedPublic

Authored by erichkeane on Oct 7 2016, 11:33 AM.

Diff Detail

Event Timeline

erichkeane updated this revision to Diff 73959.Oct 7 2016, 11:33 AM
erichkeane retitled this revision from to Fix for Bug 30639: CGDebugInfo Null dereference with OpenMP array access.
erichkeane updated this object.
erichkeane set the repository for this revision to rL LLVM.
ABataev edited edge metadata.Oct 10 2016, 1:02 AM

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?

erichkeane updated this revision to Diff 74310.Oct 11 2016, 4:37 PM
erichkeane updated this object.
erichkeane removed a reviewer: gbenyei.
erichkeane removed rL LLVM as the repository for this revision.

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.

ABataev accepted this revision.Oct 12 2016, 7:51 AM
ABataev edited edge metadata.

LG with a nit

lib/CodeGen/CGStmtOpenMP.cpp
312

Remove this->

This revision is now accepted and ready to land.Oct 12 2016, 7:51 AM
erichkeane updated this revision to Diff 74386.Oct 12 2016, 8:39 AM
erichkeane edited edge metadata.
erichkeane marked an inline comment as done.

Fixed Alexey's nit. Will need someone else to commit this, I don't yet have commit access.

I will commit it for you, Erich, no problems

This revision was automatically updated to reflect the committed changes.