Skip to content

Commit 1345ee4

Browse files
authored
[flang][cuda] Do not apply implicit data attribute on dummy arg with VALUE (#119927)
Dummy arguments with the VALUE attribute do not need the implicit data attribute.
1 parent 537e0e1 commit 1345ee4

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

flang/lib/Semantics/resolve-names.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8976,7 +8976,7 @@ void ResolveNamesVisitor::FinishSpecificationPart(
89768976
if (inDeviceSubprogram && IsDummy(symbol) &&
89778977
symbol.has<ObjectEntityDetails>()) {
89788978
auto *dummy{symbol.detailsIf<ObjectEntityDetails>()};
8979-
if (!dummy->cudaDataAttr()) {
8979+
if (!dummy->cudaDataAttr() && !IsValue(symbol)) {
89808980
// Implicitly set device attribute if none is set in device context.
89818981
dummy->set_cudaDataAttr(common::CUDADataAttr::Device);
89828982
}

flang/test/Semantics/modfile55.cuf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ end
3333
!contains
3434
!attributes(global) subroutine globsub(x,y,z)
3535
!real(4),value::x
36-
!attributes(device) x
3736
!real(4)::y
3837
!attributes(device) y
3938
!real(4)::z

0 commit comments

Comments
 (0)