Skip to content

Conversation

@TIFitis
Copy link
Member

@TIFitis TIFitis commented Dec 4, 2025

Generate implicit declare mappers only for Allocatables.

Fixes #169382 introduced by #140562.

Generate implicit declare mappers only for Allocatables.
Fixes llvm#169382 introduced by llvm#140562.
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:fir-hlfir labels Dec 4, 2025
@llvmbot
Copy link
Member

llvmbot commented Dec 4, 2025

@llvm/pr-subscribers-flang-fir-hlfir

Author: Akash Banerjee (TIFitis)

Changes

Generate implicit declare mappers only for Allocatables.

Fixes #169382 introduced by #140562.


Full diff: https://github.com/llvm/llvm-project/pull/170701.diff

1 Files Affected:

  • (modified) flang/lib/Lower/OpenMP/Utils.cpp (+1-1)
diff --git a/flang/lib/Lower/OpenMP/Utils.cpp b/flang/lib/Lower/OpenMP/Utils.cpp
index ccac64335c29a..a818d635668de 100644
--- a/flang/lib/Lower/OpenMP/Utils.cpp
+++ b/flang/lib/Lower/OpenMP/Utils.cpp
@@ -189,7 +189,7 @@ bool requiresImplicitDefaultDeclareMapper(
 
     semantics::DirectComponentIterator directComponents{spec};
     for (const semantics::Symbol &component : directComponents) {
-      if (semantics::IsAllocatableOrPointer(component))
+      if (component.attrs().test(semantics::Attr::ALLOCATABLE))
         return true;
 
       if (const semantics::DeclTypeSpec *declType = component.GetType())

Copilot finished reviewing on behalf of TIFitis December 4, 2025 16:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restricts implicit declare mapper generation in OpenMP to only allocatable components, excluding pointer components. This fixes issue #169382 that was introduced by PR #140562.

  • Modified the condition in requiresImplicitDefaultDeclareMapper to check only for allocatable attributes instead of both allocatable and pointer attributes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@agozillon agozillon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for the fix!

@TIFitis TIFitis merged commit 01737c1 into llvm:main Dec 4, 2025
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flang:fir-hlfir flang Flang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenMP V&V test test_target_map_components_default.F90 failing since #140562

3 participants