This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Nested OpenACC/OpenMP constructs (was: OpenACC GIMPLE_OACC_* -- or not?)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 10 Dec 2014 11:16:08 +0100
- Subject: Re: Nested OpenACC/OpenMP constructs (was: OpenACC GIMPLE_OACC_* -- or not?)
- Authentication-results: sourceware.org; auth=none
- References: <1383766943-8863-5-git-send-email-thomas at codesourcery dot com> <1383766943-8863-6-git-send-email-thomas at codesourcery dot com> <1383766943-8863-7-git-send-email-thomas at codesourcery dot com> <1383766943-8863-8-git-send-email-thomas at codesourcery dot com> <1383766943-8863-9-git-send-email-thomas at codesourcery dot com> <8761s5joir dot fsf at schwinge dot name> <87sihoczm0 dot fsf at kepler dot schwinge dot homeip dot net> <20141112134502 dot GC5026 at tucnak dot redhat dot com> <87sign7rgv dot fsf at kepler dot schwinge dot homeip dot net> <87iohj7r3o dot fsf at kepler dot schwinge dot homeip dot net>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Dec 10, 2014 at 11:10:19AM +0100, Thomas Schwinge wrote:
> --- /dev/null
> +++ gcc/testsuite/c-c++-common/gomp/nesting-1.c
> @@ -0,0 +1,77 @@
> +void
> +f_omp_parallel (void)
> +{
> +#pragma omp parallel
> + {
> + int i;
Can you please use a global variable declared outside of
f_omp_parallel instead?
> +
> +#pragma omp parallel
> + ;
> +
> +#pragma omp target
> + ;
> +
> +#pragma omp target data
> + ;
> +
> +#pragma omp target update to(i)
The thing is, if GCC tried harder, it could complain here,
because i can't really be mapped at this point and thus it would be always
undefined behavior. If the var is global, it is possible
somebody uses
#pragma omp target map(i)
f_omp_parallel ();
and then it would be valid. Similarly in other tests.
Otherwise LGTM.
Jakub