public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* A question about coarrays and -Warray-temporaries
@ 2021-01-31 15:51 Jorge D'Elia
  2021-02-01  7:42 ` Thomas Koenig
  2021-03-21 16:18 ` A doubt about lbound and ubound of an array inside a coarray Jorge D'Elia
  0 siblings, 2 replies; 13+ messages in thread
From: Jorge D'Elia @ 2021-01-31 15:51 UTC (permalink / raw)
  To: Gfortran List

Hi all,

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? 

Thanks in advance for some clarification. 

Greetings. 
Jorge

program test
  implicit none
  integer, parameter :: iin = kind (1)     
  integer, parameter :: idp = kind (1.0d0) 
  real    (kind=idp), allocatable :: AA (:,:)[:]
  real    (kind=idp), allocatable :: BB (:,:)
  real    (kind=idp), allocatable :: UU (:)
  integer (kind=iin) :: nn, n1, n2
  integer (kind=iin) :: j, k, k1
  !
  nn =  5
  n1 =  1
  n2 = 10
  !
  allocate (AA (1:nn,n1:n2)[*])
  allocate (BB (1:nn,n1:n2))
  allocate (UU (1:nn))
  !
  k  = 1
  k1 = k + 1
  !
  AA = 1.0_idp
  UU = 2.0_idp
  !
  do  j = 1, nn
    AA (k1:nn,j) = AA (k1:nn,j) - UU (k1:nn) * AA (k,j)
  end do
  !
  do  j = 1, nn
    BB (k1:nn,j) = BB (k1:nn,j) - UU (k1:nn) * BB (k,j)
  end do
  !
  deallocate (AA)
  deallocate (BB)
  deallocate (UU)
  !
end program test
--

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-03-21 16:16 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-31 15:51 A question about coarrays and -Warray-temporaries Jorge D'Elia
2021-02-01  7:42 ` Thomas Koenig
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

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).