This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to create builtin bzero
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Patch to create builtin bzero
- From: Richard Henderson <rth at cygnus dot com>
- Date: Wed, 22 Mar 2000 15:48:45 -0800
- Cc: egcs-patches at egcs dot cygnus dot com
- References: <200003221636.LAA11432@caip.rutgers.edu>
On Wed, Mar 22, 2000 at 11:36:10AM -0500, Kaveh R. Ghazi wrote:
> + /* Insert a zero parameter to convert bzero(x,y) -> memset(x,0,y). */
> + TREE_CHAIN (val) = TREE_CHAIN (arglist);
> + TREE_CHAIN (arglist) = val;
> + result = expand_builtin_memset(exp);
> +
> + /* If the above call fails, delete the zero parameter. */
> + if (result == 0)
> + TREE_CHAIN (arglist) = TREE_CHAIN (TREE_CHAIN (arglist));
> + return result;
I'm pretty sure the C++ front end would be mighty unhappy
with you modifying their trees. Just build a new chain with
the same TREE_VALUE contents. Then you don't have to worry
about undoing it either.
r~