[Bug fortran/33904] OpenMP: Default(shared) and wrong "lastprivate variable is private in outer context"
jakub at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Nov 12 20:03:00 GMT 2007
------- Comment #1 from jakub at gcc dot gnu dot org 2007-11-12 20:03 -------
I believe the testcase is invalid, though I'm not 100% sure.
The thing is that in OpenMP 2.5, 2.8.1.1 we have:
"Variables used as loop iteration variables in sequential loops in a parallel
construct are private in the parallel construct."
i1 and i2 are used in sequential loops within the parallel construct.
Which means that i1 and i2 are predetermined private (though can be explicitly
mentioned in private/firstprivate/lastprivate/shared/reduction clauses) and for
variables with predetermined data sharing the default clause shouldn't have any
influence.
OpenMP 3.0 draft wording here is
"Variables used as loop iteration variables in sequential loops in an implicit
or explicit task region are private in the task region."
which can shed even more light into this, because "task region" is
"A region consisting of all code encountered during the execution of a task."
and "implicit task" is "A task generated by the implicit parallel region or
generated when a parallel construct is encountered during execution."
So when a thread encounters $omp do, it doesn't create a new task region.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33904
More information about the Gcc-bugs
mailing list