This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][OpenMP] Fix declare target variables in fortran modules
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ilya Verbin <iverbin at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Tobias Burnus <burnus at net-b dot de>, Thomas Schwinge <thomas at codesourcery dot com>, Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Date: Thu, 12 Mar 2015 15:21:35 +0100
- Subject: Re: [PATCH][OpenMP] Fix declare target variables in fortran modules
- Authentication-results: sourceware.org; auth=none
- References: <20150312135635 dot GA55837 at msticlxl57 dot ims dot intel dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Mar 12, 2015 at 04:56:35PM +0300, Ilya Verbin wrote:
> This happens because the var_x is added into offload tables for both share.o and
> test.o. The patch below fixes this issue. Regtested on x86_64-linux and
> i686-linux. However I'm not sure how to create a regression test, which would
> compile 2 separate objects, and check run-time result.
Ok with proper ChangeLog entry.
As for testcase, won't dg-additional-sources help?
I mean, does it fail without your patch even if you just do
gfortran -fopenmp -o a.out share.f90 test.f90; ./a.out ?
> --- a/gcc/varpool.c
> +++ b/gcc/varpool.c
> @@ -173,7 +173,7 @@ varpool_node::get_create (tree decl)
> node = varpool_node::create_empty ();
> node->decl = decl;
>
> - if ((flag_openacc || flag_openmp)
> + if ((flag_openacc || flag_openmp) && !DECL_EXTERNAL (decl)
> && lookup_attribute ("omp declare target", DECL_ATTRIBUTES (decl)))
> {
> node->offloadable = 1;
Jakub