This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [FORTRAN PATCH] Use memcpy for array constructor assignments
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Sat, 20 Jan 2007 09:54:17 -0800
- Subject: Re: [FORTRAN PATCH] Use memcpy for array constructor assignments
- References: <18923.68.35.10.103.1169068432.squirrel@mail.eyesopen.com>
On Wed, Jan 17, 2007 at 02:13:52PM -0700, Roger Sayle wrote:
>
> 2007-01-17 Roger Sayle <roger@eyesopen.com>
>
> * dependency.c (gfc_full_array_ref_p): Check that ref->next is NULL,
> i.e. that the ARRAY_REF doesn't mention components.
> * trans-array.c (gfc_constant_array_constructor_p): Export external
> function renamed from constant_array_constructor_p.
> (gfc_build_constant_array_constructor): Export.
> (gfc_trans_array_constructor): Update call to the renamed function
> constant_array_constructor_p.
> * trans-array.h (gfc_constant_array_constructor_p): Prototype here.
> (gfc_build_constant_array_constructor): Likewise.
> * trans-expr.c (gfc_build_memcpy_call): New helper function split
> out from gfc_trans_array_copy.
> (gfc_trans_array_copy): Use gfc_build_memcpy_call.
> (gfc_trans_array_constructor_copy): New function to optimize
> assigning an entire array from a constant array constructor.
> (gfc_trans_assignment): Call gfc_trans_array_constructor_copy
> when appropriate.
>
> * gfortran.dg/array_memcpy_3.f90: New test case.
> * gfortran.dg/vect/vect-5.f90: Update vectorized loop count.
>
OK.
--
Steve