conf (pointer, elemental);
conf (pointer, codimension);
conf (allocatable, elemental);
+ conf (threadprivate, omp_groupprivate);
conf (in_common, automatic);
conf (result, automatic);
omp_clauses = c;
}
/* Also check trans-decl.cc when updating/removing the following;
- also update f95.c's gfc_gnu_attributes.
- For the warning, see also OpenMP spec issue 4663. */
- if (com->omp_groupprivate && com->threadprivate)
- {
- /* Unset this flag; implicit 'declare target local(...)' remains. */
- com->omp_groupprivate = 0;
- gfc_warning (OPT_Wopenmp,
- "Ignoring the %<groupprivate%> attribute for "
- "%<threadprivate%> common block %</%s/%> declared at %L",
- com->name, &com->where);
- }
+ also update f95.c's gfc_gnu_attributes. */
if (com->omp_groupprivate)
gfc_error ("Sorry, OMP GROUPPRIVATE not implemented, used by common "
"block %</%s/%> declared at %L", com->name, &com->where);
}
/* Also check trans-common.cc when updating/removing the following;
- also update f95.c's gfc_gnu_attributes.
- For the warning, see also OpenMP spec issue 4663. */
- if (sym_attr.omp_groupprivate && sym_attr.threadprivate)
- {
- /* Unset this flag; implicit 'declare target local(...)' remains. */
- sym_attr.omp_groupprivate = 0;
- gfc_warning (OPT_Wopenmp,
- "Ignoring the %<groupprivate%> attribute for "
- "%<threadprivate%> variable %qs declared at %L",
- sym->name, &sym->declared_at);
- }
+ also update f95.c's gfc_gnu_attributes. */
if (sym_attr.omp_groupprivate)
gfc_error ("Sorry, OMP GROUPPRIVATE not implemented, "
"used by %qs declared at %L", sym->name, &sym->declared_at);
module m
implicit none
integer :: ii
- integer :: x, y(20), z, v, u, k ! { dg-warning "Ignoring the 'groupprivate' attribute for 'threadprivate' variable 'k' declared at .1. \\\[-Wopenmp\\\]" }
+ integer :: x, y(20), z, v, u, k
! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by 'x' declared at .1." "" { target *-*-* } .-1 }
! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by 'y' declared at .1." "" { target *-*-* } .-2 }
! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by 'z' declared at .1." "" { target *-*-* } .-3 }
! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by 'v' declared at .1." "" { target *-*-* } .-4 }
! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by 'u' declared at .1." "" { target *-*-* } .-5 }
+! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by 'k' declared at .1." "" { target *-*-* } .-6 }
!
-! Note:Error different as 'groupprivate' flag is overwritten by 'threadprivate', cf. warning above.
-! { dg-error "Sorry, OMP DECLARE TARGET with LOCAL clause not implemented, used by 'k' declared at .1." "" { target *-*-* } .-8 }
!$omp groupprivate(x, z) device_Type( any )
!$omp declare target local(x) device_type ( any )
!$omp declare target enter( ii) ,local(y), device_type ( host )
!$omp groupprivate(v) device_type (nohost )
!$omp groupprivate(u)
- ! See also (currently unresolved) OpenMP Specification Issue 4663.
!$omp groupprivate(k)
- !$omp threadprivate(k)
end module
common /b_z/ z ! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by common block '/b_z/' declared at .1." }
common /b_v/ v ! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by common block '/b_v/' declared at .1." }
common /b_u/ u ! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by common block '/b_u/' declared at .1." }
- common /b_k/ k ! { dg-warning "Ignoring the 'groupprivate' attribute for 'threadprivate' common block '/b_k/' declared at .1. \\\[-Wopenmp\\\]" }
-! { dg-error "Sorry, OMP DECLARE TARGET with LOCAL clause not implemented, used by common block '/b_k/' declared at .1." "" { target *-*-* } .-1 }
+ common /b_k/ k ! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by common block '/b_k/' declared at .1." }
!$omp groupprivate(/b_x/, /b_z/) device_Type( any )
!$omp declare target local(/b_x/) device_type ( any )
!$omp groupprivate(/b_y/) device_type( host)
!$omp groupprivate(/b_v/) device_type (nohost )
!$omp groupprivate(/b_u/)
-
- ! See also (currently unresolved) OpenMP Specification Issue 4663.
!$omp groupprivate(/b_k/)
- !$omp threadprivate(/b_k/)
end module
subroutine dupl
integer :: a,b,c,d
integer :: u,v,w,x
- common /b_a/ a
- common /b_b/ b
+ common /b_a/ a ! { dg-error "THREADPRIVATE attribute conflicts with OpenMP GROUPPRIVATE attribute in 'a'" }
+ common /b_b/ b ! { dg-error "THREADPRIVATE attribute conflicts with OpenMP GROUPPRIVATE attribute in 'b'" }
common /b_c/ c
common /b_d/ d
!$omp groupprivate(/b_a/,u,/b_a/) ! { dg-error "Duplicate OpenMP GROUPPRIVATE attribute specified" }
!$omp groupprivate(v,/b_b/,v) ! { dg-error "Duplicate OpenMP GROUPPRIVATE attribute specified" }
- !$omp threadprivate(/b_a/,u,/b_a/) ! { dg-error "Duplicate THREADPRIVATE attribute specified" }
- !$omp threadprivate(v,/b_b/,v) ! { dg-error "Duplicate THREADPRIVATE attribute specified" }
+ !$omp threadprivate(/b_a/,u,/b_a/) ! { dg-error "THREADPRIVATE attribute conflicts with OpenMP GROUPPRIVATE attribute in 'a'" }
+ !$omp threadprivate(v,/b_b/,v) ! { dg-error "THREADPRIVATE attribute conflicts with OpenMP GROUPPRIVATE attribute in 'b'" }
end
!!$omp target enter data map(to : /com/) ! -> PR fortran/92730
end
+subroutine g1
+integer, save :: x
+!$omp threadprivate(x)
+!$omp groupprivate(x) ! { dg-error "THREADPRIVATE attribute conflicts with OpenMP GROUPPRIVATE attribute in 'x'" }
+end
+
+subroutine g2
+integer, save :: y
+!$omp groupprivate(y)
+!$omp threadprivate(y) ! { dg-error "THREADPRIVATE attribute conflicts with OpenMP GROUPPRIVATE attribute in 'y'" }
+end
+
+subroutine h
+ ! Hmm, for some reasons, it is diagnosed twice ...
+ integer :: k
+ common /b_k/ k ! { dg-error "THREADPRIVATE attribute conflicts with OpenMP GROUPPRIVATE attribute in 'k'" }
+ !$omp groupprivate(/b_k/)
+ !$omp threadprivate(/b_k/) ! { dg-error "THREADPRIVATE attribute conflicts with OpenMP GROUPPRIVATE attribute in 'k'" }
+end
end module