public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/48655] New: False positive with -Warray-temporaries and a=transpose(a)
@ 2011-04-17 20:16 tkoenig at gcc dot gnu.org
  2013-01-07 22:56 ` [Bug fortran/48655] " dominiq at lps dot ens.fr
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-04-17 20:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48655

           Summary: False positive with -Warray-temporaries and
                    a=transpose(a)
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tkoenig@gcc.gnu.org


Well, the front end generates the temporary, but the middle end removes it
again.

ig25@linux-fd1f:~/Dokumente/ig25/Transpose> cat foo.f90               
subroutine foo(a,x)                               
  real, dimension(3,3), intent(out) :: a                                   
  real, intent(in) :: x

  a(1,1) = 1.0
  a(2,1) = 1.3 + x
  a(3,1) = 1.0    
  a(1,2) = 1.43   
  a(2,2) = 2*x    
  a(3,2) = x**2   
  a(1,3) = -x     
  a(2,3) = -x**2  
  a(3,3) = 2.1    
  a = transpose(a)
end subroutine foo

ig25@linux-fd1f:~/Dokumente/ig25/Transpose> gfortran -O3 -c
-fdump-tree-optimized -fdump-tree-original -Warray-temporaries foo.f90          
foo.f90:14.6:                                                                   

  a = transpose(a)
      1
Warnung: Creating array temporary at (1)
ig25@linux-fd1f:~/Dokumente/ig25/Transpose> cat foo.f90.142t.optimized

;; Function foo (foo_)

foo (real(kind=4)[9] * restrict a, real(kind=4) & restrict x)
{
  real(kind=4) D.1549;
  real(kind=4) D.1586;
  real(kind=4) D.1585;
  real(kind=4) D.1584;
  real(kind=4) D.1583;
  real(kind=4) D.1582;

<bb 2>:
  *a_5(D)[0] = 1.0e+0;
  D.1582_7 = *x_6(D);
  D.1583_8 = D.1582_7 + 1.2999999523162841796875e+0;
  D.1584_10 = D.1582_7 * 2.0e+0;
  *a_5(D)[4] = D.1584_10;
  D.1549_12 = D.1582_7 * D.1582_7;
  D.1585_14 = -D.1582_7;
  D.1586_17 = -D.1549_12;
  *a_5(D)[8] = 2.099999904632568359375e+0;
  *a_5(D)[1] = 1.42999994754791259765625e+0;
  *a_5(D)[2] = D.1585_14;
  *a_5(D)[3] = D.1583_8;
  *a_5(D)[5] = D.1586_17;
  *a_5(D)[6] = 1.0e+0;
  *a_5(D)[7] = D.1549_12;
  return;

}


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

end of thread, other threads:[~2020-04-14 18:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-17 20:16 [Bug fortran/48655] New: False positive with -Warray-temporaries and a=transpose(a) tkoenig at gcc dot gnu.org
2013-01-07 22:56 ` [Bug fortran/48655] " dominiq at lps dot ens.fr
2014-12-07 14:34 ` dominiq at lps dot ens.fr
2020-04-14 18:08 ` [Bug fortran/48655] "False positive" with -Warray-temporaries or missing warning with -fcheck=array-temps nickpapior at gmail dot com

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