This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32131] New: knowing that stride==1 when using allocated arrays
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 May 2007 19:56:53 -0000
- Subject: [Bug fortran/32131] New: knowing that stride==1 when using allocated arrays
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Look at this:
$ cat allocate-loop.f90
program main
implicit none
real, allocatable, dimension(:) :: a, b, c
real, dimension(10) :: d, e, f
real :: s
allocate (a(10), b(10), c(10))
call random_number(a)
call random_number(b)
c = a+b
s = sum(c)
print *,s
call random_number(d)
call random_number(e)
f = d+e
s = sum(f)
print *,f
end program main
$ gfortran -march=athlon-xp -O3 -ftree-vectorize -ftree-vectorizer-verbose=4
allocate-loop.f90
allocate-loop.f90:15: note: not vectorized: unsupported use in stmt.
allocate-loop.f90:14: note: LOOP VECTORIZED.
allocate-loop.f90:10: note: not vectorized: unsupported use in stmt.
allocate-loop.f90:9: note: not vectorized: unhandled data-ref
allocate-loop.f90:1: note: vectorized 1 loops in function.
The loop at line 9 (c=a+b) could be vectorized if the stride was
known to be 1 (which isn't made known to the middle end in this case).
--
Summary: knowing that stride==1 when using allocated arrays
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tkoenig at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32131