public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Koenig <tkoenig@netcologne.de>
To: Jorge D'Elia <jdelia@cimec.unl.edu.ar>,
	Gfortran List <fortran@gcc.gnu.org>
Subject: Re: A question about coarrays and -Warray-temporaries
Date: Mon, 1 Feb 2021 08:42:19 +0100	[thread overview]
Message-ID: <9d298701-38a5-c2c5-1daf-7a2dad754369@netcologne.de> (raw)
In-Reply-To: <121178681.597.1612108263047.JavaMail.zimbra@intec.unl.edu.ar>


Hi Jorge,

> 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.
> 
> 
> $ gfortran --version
> GNU Fortran (GCC) 11.0.0 20210125 (experimental)
> Copyright (C) 2021 Free Software Foundation, Inc.
> 
> $ gfortran -march=native -mtune=native -Ofast -fcheck=all -fcoarray=single -std=f2018 -Wall -Wextra -Warray-temporaries -o test.exe test.f90
> test.f90:37:19:
> 
>     37 |     AA (k1:nn,j) = AA (k1:nn,j) - UU (k1:nn) * AA (k,j)
>        |                   1
> Warning: Creating array temporary at (1) [-Warray-temporaries]
> 
> 
> Why this difference in behavior? Is it ok?

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.

Best regards

	Thomas

  reply	other threads:[~2021-02-01  7:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-31 15:51 Jorge D'Elia
2021-02-01  7:42 ` Thomas Koenig [this message]
2021-02-01 10:43   ` Jorge D'Elia
2021-02-01 11:52   ` Tobias Burnus
2021-02-02 11:46     ` [Patch] Fortran: Fix Array dependency with local coarrays [PR98913] (was: Re: A question about coarrays and -Warray-temporaries) Tobias Burnus
2021-02-02 14:32       ` Jorge D'Elia
2021-02-02 14:54       ` Thomas Koenig
2021-02-02 17:15         ` Tobias Burnus
2021-02-09 11:52           ` [Patch] Fortran: Fix coarray handling for gfc_dep_resolver [PR99010] (was: Re: [Patch] Fortran: Fix Array dependency with local coarrays [PR98913] Tobias Burnus
2021-02-13 19:57             ` Tobias Burnus
2021-02-19  9:33             ` *PING**2 " Tobias Burnus
2021-02-19 16:25               ` Jerry DeLisle
2021-03-21 16:18 ` A doubt about lbound and ubound of an array inside a coarray Jorge D'Elia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d298701-38a5-c2c5-1daf-7a2dad754369@netcologne.de \
    --to=tkoenig@netcologne.de \
    --cc=fortran@gcc.gnu.org \
    --cc=jdelia@cimec.unl.edu.ar \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).