public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/33904] OpenMP: Default(shared) and wrong "lastprivate variable is private in outer context"
Date: Mon, 12 Nov 2007 20:03:00 -0000	[thread overview]
Message-ID: <20071112200337.23909.qmail@sourceware.org> (raw)
In-Reply-To: <bug-33904-13404@http.gcc.gnu.org/bugzilla/>



------- 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


  parent reply	other threads:[~2007-11-12 20:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-26  7:41 [Bug fortran/33904] New: " burnus at gcc dot gnu dot org
2007-11-02 15:27 ` [Bug fortran/33904] " fxcoudert at gcc dot gnu dot org
2007-11-12 20:03 ` jakub at gcc dot gnu dot org [this message]
2007-11-12 21:46 ` jakub at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071112200337.23909.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).