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: [PATCH] remove build_call_list from Fortran FE


On Thu, Jul 1, 2010 at 4:50 PM, Nathan Froyd <froydnj@codesourcery.com> wrote:
> The patch below removes build_call_list from the Fortran FE by making
> gfc_conv_procedure_call use build_call_vec. ?It's not quite as clean as
> one might like, mostly because appending vectors is not nearly so nice
> as appending lists. ?The patch does have the nice benefit of removing
> quadratic behavior from gfc_conv_procedure_call, so gfortran should get
> slightly faster.
>
> This patch removes the last use of build_call_list in GCC. ?If approved,
> I will commit the build_call_list removal followup patch as obvious.
>
> Tested on x86_64-unknown-linux-gnu. ?OK to commit?

...
>
> +/* Copy the elements in SRC to DST, starting at INDEX in DST. ?Return
> + ? the next spot at which elements are to be added. ?DST is assumed to
> + ? have sufficient space available to hold SRC's elements. ?*/
> +
> +static int
> +append_vec (VEC(tree,gc) *dst, VEC(tree,gc) *src, int index)
> +{
> + ?int len = VEC_length (tree, src);
> + ?memcpy (VEC_address (tree, dst) + index, VEC_address (tree, src),
> + ? ? ? ? len * sizeof (tree));
> +
> + ?return index + len;
> +}

Finally a reason to add VEC_splice?

Richard.


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