Skip to content

Commit

Permalink
[flang][cuda] Do not apply implicit data attribute on dummy arg with …
Browse files Browse the repository at this point in the history
…VALUE (#119927)

Dummy arguments with the VALUE attribute do not need the implicit data
attribute.
  • Loading branch information
clementval authored Dec 13, 2024
1 parent 537e0e1 commit 1345ee4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion flang/lib/Semantics/resolve-names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8976,7 +8976,7 @@ void ResolveNamesVisitor::FinishSpecificationPart(
if (inDeviceSubprogram && IsDummy(symbol) &&
symbol.has<ObjectEntityDetails>()) {
auto *dummy{symbol.detailsIf<ObjectEntityDetails>()};
if (!dummy->cudaDataAttr()) {
if (!dummy->cudaDataAttr() && !IsValue(symbol)) {
// Implicitly set device attribute if none is set in device context.
dummy->set_cudaDataAttr(common::CUDADataAttr::Device);
}
Expand Down
1 change: 0 additions & 1 deletion flang/test/Semantics/modfile55.cuf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ end
!contains
!attributes(global) subroutine globsub(x,y,z)
!real(4),value::x
!attributes(device) x
!real(4)::y
!attributes(device) y
!real(4)::z
Expand Down

0 comments on commit 1345ee4

Please sign in to comment.