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] Optimize (void) stpcpy (s1, s2) and (void) mempcpy (s1,s2)


Jakub Jelinek <jakub@redhat.com> writes:

> Hi!
>
> If the result of stpcpy or mempcpy is never used, it is ok to use strcpy
> resp. memcpy instead no matter whether they will be further optimized or
> not.
> Bootstrapped on i686-redhat-linux, no regressions.
> Ok to commit?
>
> 2003-05-05  Jakub Jelinek  <jakub@redhat.com>
>
> 	* builtins.c (expand_builtin_mempcpy): New function.
> 	(expand_builtin_stpcpy): Optimize stpcpy whose return value is
> 	ignored into strcpy no matter what arguments it has.
> 	(expand_builtin) <case BUILT_IN_MEMPCPY>: Call
> 	expand_builtin_mempcpy.

This is OK, but ...


> 	* gcc.c-torture/execute/string-opt-18.c (main): Add 3 new tests.

this doesn't appear to test that the optimization actually happens,
can you work out a test that does?

zw


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