[Bug fortran/48655] New: False positive with -Warray-temporaries and a=transpose(a)
tkoenig at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Apr 17 20:16:00 GMT 2011
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;
}
More information about the Gcc-bugs
mailing list