[flang-commits] [flang] [flang][OpenMP] Skip default privatization for crashing cases (PR #71922)

via flang-commits flang-commits at lists.llvm.org
Fri Nov 10 03:07:59 PST 2023


https://github.com/NimishMishra created https://github.com/llvm/llvm-project/pull/71922

This patch skips default privatization for crashing cases like namelists, reduction instrinsics, and structure constructor.

Fixes: https://github.com/llvm/llvm-project/issues/67332, https://github.com/llvm/llvm-project/issues/66454, and https://github.com/llvm/llvm-project/issues/65569

Co-Authored-By: kiranchandramohan <kiran.chandramohan at arm.com>

>From 83a39974bba0868332ec85b0938da4a7c6de01bd Mon Sep 17 00:00:00 2001
From: Nimish Mishra <neelam.nimish at gmail.com>
Date: Fri, 10 Nov 2023 16:29:45 +0530
Subject: [PATCH] [flang][OpenMP] Skip default privatization for namelists,
 reduction instrinsics, and constructor

---
 flang/lib/Lower/OpenMP.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp
index 945066549299d77..60db450d9be1508 100644
--- a/flang/lib/Lower/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP.cpp
@@ -483,7 +483,10 @@ void DataSharingProcessor::defaultPrivatize() {
   for (const Fortran::semantics::Symbol *sym : defaultSymbols) {
     if (!symbolsInNestedRegions.contains(sym) &&
         !symbolsInParentRegions.contains(sym) &&
-        !privatizedSymbols.contains(sym)) {
+        !privatizedSymbols.contains(sym) &&
+        !Fortran::semantics::IsProcedure(*sym) &&
+        !sym->GetUltimate().has<Fortran::semantics::DerivedTypeDetails>() &&
+        !sym->GetUltimate().has<Fortran::semantics::NamelistDetails>()) {
       cloneSymbol(sym);
       copyFirstPrivateSymbol(sym);
     }



More information about the flang-commits mailing list