This is an archive of the discontinued LLVM Phabricator instance.

[Flang][OpenMP] Use the ultimate symbol in a call to the IsPointer function
ClosedPublic

Authored by kiranchandramohan on Oct 30 2021, 1:32 PM.

Details

Summary

The IsPointer check currently fails for host-associated symbols in OpenMP regions. This causes some failures in semantic checks for pointer association in an OpenMP region. Fix is to use the ultimate symbol in the call to the IsPointer function in CheckPointerAssignment
function in lib/Semantics/pointer-assignment.cpp.

This patch fixes the issue reported by Peixin in https://github.com/flang-compiler/f18-llvm-project/issues/1171#issuecomment-955180002.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald Transcript
kiranchandramohan requested review of this revision.Oct 30 2021, 1:32 PM
peixin accepted this revision.Nov 1 2021, 12:49 AM

Thanks @kiranchandramohan. LGTM. Please fix the code format warning.

BTW, this also fix the case when the pointer is in common block and the common block is in private clause.

Could you please cherry-pick this patch to fir-dev after merged? I need fix https://github.com/flang-compiler/f18-llvm-project/pull/1179 if this patch is merged since this patch affects the lowering of copying symbols in private clause.

This revision is now accepted and ready to land.Nov 1 2021, 12:49 AM

clang-format changes

Use the ultimate symbol as argument to the IsPointer function in CheckPointerAssignment
function in lib/Semantics/pointer-assignment.cpp. As suggested by @klausler.

klausler accepted this revision.Nov 4 2021, 10:45 AM
kiranchandramohan retitled this revision from [Flang][OpenMP] Copy the attributes when creating a host-associated symbol to [Flang][OpenMP] Use the ultimate symbol in a call to the IsPointer function.Nov 4 2021, 10:49 AM
kiranchandramohan edited the summary of this revision. (Show Details)