This is the mail archive of the 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: [RFC PATCH] fold one element {mem{set,cpy,pcpy,move},b{zero,copy}} (PR middle-end/27567)

Hi Jakub,

On Fri, 1 Sep 2006, Jakub Jelinek wrote:
> 2006-09-01  Jakub Jelinek  <>
>	PR middle-end/27567
>	* builtins.c (fold_builtin_memcpy, fold_builtin_memmove): Remove.
>	(fold_builtin_mempcpy): Rename to...
>	(fold_builtin_memory_op): ... this.  Optimize one element copy
>	into an assignment.
>	(fold_builtin_memset, fold_builtin_bzero, fold_builtin_bcopy): New
>	functions.
>	(expand_builtin_strcpy, expand_builtin_strncpy): Handle COMPOUND_EXPR.
>	(expand_builtin_memcpy, expand_builtin_mempcpy,
>	expand_builtin_memmove): Likewise.  Use fold_builtin_memory_op.
>	(fold_builtin_1): Handle BUILT_IN_MEMSET, BUILT_IN_BZERO and
>	BUILT_IN_BCOPY.  Use fold_builtin_memory_op for

Ok, this revised version is OK for mainline.  It catches all the cases
where a memset is really just a simple assignment, i.e. those that could
be usefully optimized via tree-ssa.  I'm also happier that we leave the
rare/corner cases of unaligned memcpy until RTL expansion which has been
well tested.

Let's see how this behaves on mainline for a while, before deciding on
what to do about PR 27567 on the 4.0 branch.

Thanks again,


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