This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Optimize (void) stpcpy (s1, s2) and (void) mempcpy (s1, s2)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 5 May 2003 13:45:19 -0400
- Subject: Re: [PATCH] Optimize (void) stpcpy (s1, s2) and (void) mempcpy (s1, s2)
- References: <20030505145107.GT16629@sunsite.ms.mff.cuni.cz> <87vfwpbce9.fsf@egil.codesourcery.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, May 05, 2003 at 09:12:46AM -0700, Zack Weinberg wrote:
> > * 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?
It does. If this optimization doesn't happen, stpcpy (resp. mempcpy)
function is called as opposed to strcpy/memcpy.
The test #ifdef __OPTIMIZE__ provides implementation for stpcpy/mempcpy
which simply abort.
Jakub