[PATCH] D112876: [Flang][OpenMP] Use the ultimate symbol in a call to the IsPointer function

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 4 12:54:32 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG48dc5c8e731b: [Flang][OpenMP] Use the ultimate symbol in a call to the IsPointer function (authored by kiranchandramohan).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112876/new/

https://reviews.llvm.org/D112876

Files:
  flang/lib/Semantics/pointer-assignment.cpp
  flang/test/Semantics/omp-private-is-pointer-check.f90


Index: flang/test/Semantics/omp-private-is-pointer-check.f90
===================================================================
--- /dev/null
+++ flang/test/Semantics/omp-private-is-pointer-check.f90
@@ -0,0 +1,10 @@
+! RUN: %flang_fc1 -fopenmp -fsyntax-only %s
+
+subroutine s
+  integer, pointer :: p
+  integer, target :: t
+
+  !$omp parallel private(p)
+    p=>t
+  !$omp end parallel
+end subroutine
Index: flang/lib/Semantics/pointer-assignment.cpp
===================================================================
--- flang/lib/Semantics/pointer-assignment.cpp
+++ flang/lib/Semantics/pointer-assignment.cpp
@@ -383,7 +383,7 @@
   if (!pointer) {
     return false; // error was reported
   }
-  if (!IsPointer(*pointer)) {
+  if (!IsPointer(pointer->GetUltimate())) {
     evaluate::SayWithDeclaration(context.messages(), *pointer,
         "'%s' is not a pointer"_err_en_US, pointer->name());
     return false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112876.384852.patch
Type: text/x-patch
Size: 925 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211104/c4807bca/attachment.bin>


More information about the llvm-commits mailing list