This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] don't bzero->memset if cfun is memset
- From: DJ Delorie <dj at redhat dot com>
- To: mark at codesourcery dot com
- Cc: mdb at gnu dot org, geoffk at geoffk dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 11 Jul 2002 23:21:46 -0400
- Subject: Re: [patch] don't bzero->memset if cfun is memset
- References: <62110000.1026442218@warlock.codesourcery.com>
> I wouldn't object to removing the bzero->memset conversion; I think
> that would be cleaner than trying to avoid doing the conversion when
> it's inappropriate, and, as you say, I don't see where there's a lot
> of win in doing that conversion anyhow.
Actually, it's a bit more subtle than that. There's code in
expand_builtin_bzero() to make sure that bzero is called if it's not
open coded. It doesn't work, because expand_builtin_memcpy() calls
clear_storage() which emits a call to memset, so effectively it's
*always* "open coded" as far as expand_builtin_bzero() is concerned.
Perhaps clear_storage() needs a parameter that says if it should fail
if it requires a library function?