This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [fortran PATCH] Implement a(:,:) = 0.0 using memset


Hi Tobi,
> Does this work for strided arrays?  Say
> program t
>   real :: arr(4)
>   call a(arr(1:4:2))
>   print *, arr
> contains
> 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.

Roger
--



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]