Hi Tobias,,

----- Mensaje original -----
> De: "Tobias Burnus" 
> Para: "Thomas Koenig" , "jdelia" <jde...@cimec.unl.edu.ar>, "Gfortran List"
> gcc.gnu.org>, "GCC Patches" <gcc-patches@gcc.gnu.org>
> Enviados: Martes, 2 de Febrero 2021 8:46:00
> Asunto: [Patch] Fortran: Fix Array dependency with local coarrays [PR98913] 
> (was: Re: A question about coarrays and
> -Warray-temporaries)
>
> Hi all,
> 
> the attached patch now handles -fcoarray=single and access to the local
> image like no coarray access, using the same check a before.

I would like to apply the patch but, sorry, how do I proceed? 
Where in the gcc tree to apply the patch file? 
Should I use git apply or diff? e.g. it does not work with

$ pwd
/home/bigpack/gcc-paq/sources/gcc-11.0-20210202
$ git apply dep-caf.diff
error: patch failed: gcc/fortran/dependency.c:30
error: gcc/fortran/dependency.c: patch does not apply

> Actually, I think we could remove the if (..coarray..) check completely:
> For 'single', it is like no coarrays; for 'lib' both AA[remote] =... and
> "AA = ... AA[remove]" will create a function call and uses already
> temporaries. I don't know what 'native'/'threads' does – but either it
> the image index is different, then no temporary is needed at all – or it
> is the same (in particular: this_image / not present), but then the
> noncoarray analysis would work.
> 
> (Knowing that for i != this_image(), AA and AA[i] – or i /= j for AA[i]
> and AA[j] – we could further relax the checks, but I don't think that
> that's needed.)
> 
> Hence: Is the patch OK for the trunk? Or should we completely get rid of
> if-conditional block?

Thanks for the fast work with this code optimization issue.

Regards,
Jorge.

> --
> On 01.02.21 12:52, Tobias Burnus wrote:
> 
>> On 01.02.21 08:42, Thomas Koenig via Fortran wrote:
>>>> I have a question with -Warray-temporaries in the test below.
>>>> With the AA coarray that warning appears in the first loop (on its
>>>> local part),
>>>> but not with the BB array with the same task, i.e. [...]
>>> It seems that dependency checking does not detect that no overlap
>>> can exist in that case, and so generates a temporary.  Probably,
>>> dependency checking was not updated when coarrays were introduced.
>>> This is a missed optimization, not a correctness issue.
>> I have now filled https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98913
> -----------------
> Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München
> Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank
> Thürauf

Reply via email to