public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Cesar Philippidis <cesar@codesourcery.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	       Fortran List <fortran@gcc.gnu.org>
Subject: Re: [gomp4] don't error on implicitly private induction variables in gfortran
Date: Fri, 27 Jan 2017 15:07:00 -0000	[thread overview]
Message-ID: <20170127150719.GV1867@tucnak> (raw)
In-Reply-To: <ac10bd90-b1e1-c03d-1ad4-436974da1ab4@codesourcery.com>

On Fri, Jan 27, 2017 at 07:02:45AM -0800, Cesar Philippidis wrote:
> While experimenting with some new OpenACC benchmarks, I noticed that
> gfortran errors when the user explicitly marks loop induction variables
> as private. I applied this patch to gomp-4_0-branch to resolve that problem.
> 
> Cesar

> 2017-01-26  Cesar Philippidis  <cesar@codesourcery.com>
> 
> 	gcc/fortran/
> 	* openmp.c (gfc_resolve_oacc_blocks): Populate list of private
> 	variables.
> 
> 	gcc/testsuite/
> 	* gfortran.dg/goacc/implicitly-private.f90: New test.
> 
> 
> diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
> index 61940d7..2782a8d 100644
> --- a/gcc/fortran/openmp.c
> +++ b/gcc/fortran/openmp.c
> @@ -5192,7 +5192,8 @@ gfc_resolve_oacc_blocks (gfc_code *code, gfc_namespace *ns)
>  {
>    fortran_omp_context ctx;
>    oacc_function dims = OACC_FUNCTION_NONE;
> -
> +  gfc_omp_namelist *n;
> +  
>    resolve_oacc_loop_blocks (code);
>  
>    ctx.code = code;
> @@ -5217,6 +5218,10 @@ gfc_resolve_oacc_blocks (gfc_code *code, gfc_namespace *ns)
>    ctx.dims = dims;
>    omp_current_ctx = &ctx;
>  
> +  if (code->ext.omp_clauses)
> +    for (n = code->ext.omp_clauses->lists[OMP_LIST_PRIVATE]; n; n = n->next)
> +      ctx.private_iterators->add (n->sym);

Do you really want to add to private_iterators even variables that aren't
iterators, just arbitrary private variable?

	Jakub

  reply	other threads:[~2017-01-27 15:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-11 23:55 [patch,gomp4] make fortran loop variables implicitly private in openacc Cesar Philippidis
2014-08-13  3:55 ` Cesar Philippidis
2014-08-13 20:41 ` Tobias Burnus
2014-08-14 11:15   ` Thomas Schwinge
2014-08-22 15:08   ` Cesar Philippidis
2014-09-08  6:26     ` Tobias Burnus
2014-09-09  1:25       ` Cesar Philippidis
2017-01-27 15:03 ` [gomp4] don't error on implicitly private induction variables in gfortran Cesar Philippidis
2017-01-27 15:07   ` Jakub Jelinek [this message]
2017-01-27 15:17     ` Cesar Philippidis
2018-08-07 22:04   ` [PATCH][OpenACC] Don't " Cesar Philippidis
2019-04-17  8:38     ` [PR90048] Fortran OpenACC 'private' clause rejected for predetermined private loop iteration variable (was: [patch,gomp4] make fortran loop variables implicitly private in openacc) Thomas Schwinge

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=20170127150719.GV1867@tucnak \
    --to=jakub@redhat.com \
    --cc=cesar@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@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).