[patch] Fortran fix for PR70289

Cesar Philippidis cesar@codesourcery.com
Mon Apr 4 21:35:00 GMT 2016


On 04/01/2016 08:17 AM, Jakub Jelinek wrote:
> 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

The gimplify approach didn't turn out to be that bad after all. Is this
patch ok for trunk? It fixes the problem for all fo the FEs.

Cesar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr70289-20160404.diff
Type: text/x-patch
Size: 11651 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160404/b23014c9/attachment.bin>


More information about the Gcc-patches mailing list