This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/38181] calls to SIZE not optimized out of loops
- From: "dominiq at lps dot ens dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Nov 2008 21:38:08 -0000
- Subject: [Bug fortran/38181] calls to SIZE not optimized out of loops
- References: <bug-38181-6642@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from dominiq at lps dot ens dot fr 2008-11-19 21:38 -------
It seems that the problem is a missed vectorization. For
INTEGER FUNCTION F1(a)
integer :: a(:,:), m, n
m=SIZE(a,1)
n=SIZE(a,2)
F1=0
DO k=1,n
DO j=1,m
F1=F1+a(j,k)
ENDDO
ENDDO
END FUNCTION F1
I get with gfortran
pr38181_2.f90:6: note: not vectorized: too many BBs in loop.
pr38181_2.f90:7: note: not vectorized: data ref analysis failed D.1605_54 =
(*a.0_10)[D.1604_53];
pr38181_2.f90:1: note: vectorized 0 loops in function.
while ifort reports:
pr38181_2.f90(9): (col. 3) remark: LOOP WAS VECTORIZED.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38181