Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flang] Avoid new spurious error under -fopenacc #78504

Merged
merged 1 commit into from
Jan 17, 2024
Merged

Conversation

klausler
Copy link
Contributor

Don't create HostAssocDetails symbols for subprograms in OpenACC regions; it can cause warnings to became errors later in compilation when calls do not appear to be to external procedures with implicit interfaces.

Don't create HostAssocDetails symbols for subprograms in
OpenACC regions; it can cause warnings to became errors later
in compilation when calls do not appear to be to external
procedures with implicit interfaces.
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:openmp flang:semantics labels Jan 17, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 17, 2024

@llvm/pr-subscribers-flang-semantics

@llvm/pr-subscribers-flang-openmp

Author: Peter Klausler (klausler)

Changes

Don't create HostAssocDetails symbols for subprograms in OpenACC regions; it can cause warnings to became errors later in compilation when calls do not appear to be to external procedures with implicit interfaces.


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

1 Files Affected:

  • (modified) flang/lib/Semantics/resolve-directives.cpp (+1-1)
diff --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp
index b30b81cf90c951..e31193f490f79a 100644
--- a/flang/lib/Semantics/resolve-directives.cpp
+++ b/flang/lib/Semantics/resolve-directives.cpp
@@ -1313,7 +1313,7 @@ void AccAttributeVisitor::Post(const parser::Name &name) {
   auto *symbol{name.symbol};
   if (symbol && !dirContext_.empty() && GetContext().withinConstruct) {
     if (!symbol->owner().IsDerivedType() && !symbol->has<ProcEntityDetails>() &&
-        !IsObjectWithDSA(*symbol)) {
+        !symbol->has<SubprogramDetails>() && !IsObjectWithDSA(*symbol)) {
       if (Symbol * found{currScope().FindSymbol(name.source)}) {
         if (symbol != found) {
           name.symbol = found; // adjust the symbol within region

Copy link
Contributor

@razvanlupusoru razvanlupusoru left a comment

Choose a reason for hiding this comment

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

Thank you.

@klausler klausler merged commit 345c1ea into llvm:main Jan 17, 2024
6 of 7 checks passed
@klausler klausler deleted the fs29132 branch January 17, 2024 22:03
ampandey-1995 pushed a commit to ampandey-1995/llvm-project that referenced this pull request Jan 19, 2024
Don't create HostAssocDetails symbols for subprograms in OpenACC
regions; it can cause warnings to became errors later in compilation
when calls do not appear to be to external procedures with implicit
interfaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:openmp flang:semantics flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants