This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fortran fix for PR70289
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Cesar Philippidis <cesar at codesourcery dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Fortran List <fortran at gcc dot gnu dot org>
- Date: Fri, 1 Apr 2016 17:17:35 +0200
- Subject: Re: [patch] Fortran fix for PR70289
- Authentication-results: sourceware.org; auth=none
- References: <56FE8A6C dot 2000004 at codesourcery dot com> <20160401145600 dot GX3017 at tucnak dot redhat dot com> <56FE8EAC dot 3070402 at codesourcery dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Apr 01, 2016 at 08:07:24AM -0700, Cesar Philippidis wrote:
> On 04/01/2016 07:56 AM, Jakub Jelinek wrote:
> > On Fri, Apr 01, 2016 at 07:49:16AM -0700, Cesar Philippidis wrote:
> >> The bug in PR70289 is an assertion failure triggered by a static
> >> variable used inside an offloaded acc region which doesn't have a data
> >> clause associated with it. Basically, that static variable ends up in a
> >> different lto partition, which was not streamed to the offloaded
> >> compiler. I'm not sure if we should try to replicate the static storage
> >> in the offloaded regions, but it probably doesn't make sense in a
> >> parallel environment anyway.
> >
> > Is this really Fortran specific? I'd expect the diagnostics to be in
> > gimplify.c and handle it for all 3 FEs...
>
> By the time the variable reaches the gimplifier, the reduction variable
> may no longer match the ones inside the data clause. E.g. consider this
> directive inside a fortran subroutine:
>
> !$acc parallel copyout(temp) reduction(+:temp)
>
> The gimplifier would see something like:
>
> map(force_from:*temp.2 [len: 4]) map(alloc:temp [pointer assign, bias:
> 0]) reduction(+:temp)
>
> At this point, unless I'm mistaken, it would be difficult to tell if
> temp.2 is a pointer to the same temp in the reduction. Maybe I'm missing
> something?
All the info is still there, and this wouldn't be the only case where
we rely on exact clause ordering. I think that is still much better than
doing it in all the FEs.
Jakub