This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Builtin strcpy/strncpy/memcpy/strcmp/fputs fixes and optimizations
- To: Jakub Jelinek <jakub at redhat dot com>
- Subject: Re: [PATCH] Builtin strcpy/strncpy/memcpy/strcmp/fputs fixes and optimizations
- From: Richard Henderson <rth at redhat dot com>
- Date: Wed, 29 Nov 2000 01:04:01 -0800
- Cc: ghazi at caip dot rutgers dot edu, gcc-patches at gcc dot gnu dot org
- References: <20001129085056.A681@sunsite.ms.mff.cuni.cz>
On Wed, Nov 29, 2000 at 08:50:56AM +0100, Jakub Jelinek wrote:
> So that strncpy can be handled by that code, I had to split it into a test
> phase (can_store_by_pieces) which does not emit any instructions and actual
> action function (store_by_pieces), because at the moment we want to return 0
> and fallback to strncpy call if that fails.
I don't see that such duplication of code is required. You could simply
have store_by_pieces call start_sequence, and if the constant generator
fails, abandon the sequence without emitting it.
Am I missing something here?
Also, it seems like it would make more sense for store_by_pieces_2 to
check the legitimacy of the constant rather than having each separate
generator be responsible for doing that.
r~