This is the mail archive of the
mailing list for the GCC project.
Re: [fortran PATCH] Implement a(:,:) = 0.0 using memset
> Does this work for strided arrays? Say
> program t
> real :: arr(4)
> call a(arr(1:4:2))
> print *, arr
> subroutine a(b)
> real :: b(:)
> b(:) = 0
> end subroutine
> end program
It works in the sense that it knows to leave the assignment of "b(:)"
alone and not use memset. In theory, it should be possible to inspect
the array descriptor at run-time and determine whether the array sections
are sequential, but currently if the array reference requires an array
descriptor, this optimization is skipped. This may be too conservative
for some common codes? It'd be nice to have some statistics.