gcc/fortran/ChangeLog: * gfortran.h (gfc_omp_namelist): Add lastprivate_conditional. * openmp.c (gfc_match_omp_clauses): Handle 'conditional:' modifier of 'lastprivate'. * trans-openmp.c (gfc_omp_clause_default_ctor): Don't assert on OMP_CLAUSE__CONDTEMP_ and other OMP_*TEMP_. (gfc_trans_omp_variable_list): Handle lastprivate_conditional. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/lastprivate-conditional-1.f90: New test. * gfortran.dg/gomp/lastprivate-conditional-2.f90: New test. * gfortran.dg/gomp/lastprivate-conditional-3.f90: New test. * gfortran.dg/gomp/lastprivate-conditional-4.f90: New test. * gfortran.dg/gomp/lastprivate-conditional-5.f90: New test.
29 lines
541 B
Fortran
29 lines
541 B
Fortran
module m
|
|
integer x, w
|
|
end module m
|
|
|
|
subroutine foo
|
|
use m
|
|
interface
|
|
logical function bar(i)
|
|
integer i
|
|
end function
|
|
end interface
|
|
integer y, i, z
|
|
logical tmp
|
|
y = 5
|
|
!$omp teams num_teams(1) firstprivate (x) shared (y) shared (w)
|
|
!$omp parallel do firstprivate (x, y, z, w) lastprivate (conditional: x, y, z, w)
|
|
do i = 1, 64
|
|
if (bar (i)) then
|
|
x = i;
|
|
y = i + 1;
|
|
z = i + 2;
|
|
w = i + 3;
|
|
end if
|
|
tmp = bar (y);
|
|
tmp = bar (z);
|
|
end do
|
|
!$omp end teams
|
|
end
|