[PATCH] Built-in redirection

Zack Weinberg zack@codesourcery.com
Sun Apr 27 19:39:00 GMT 2003

Jakub Jelinek <jakub@redhat.com> writes:

> Hi!
> The following patch implements what should help glibc to cut down the number
> of .plt slots.
> ATM GCC, if it sees prototype like:
> viod *memcpy (void *, const void *, size_t) __asm ("__GI_memcpy");
> memcpy is no longer a builtin (but memcpy calls generated internally by the
> compiler still are calls to memcpy, not __GI_memcpy).
> With this patch, memcpy is still the builtin, but if GCC decides to call
> memcpy, it will call it using the __GI_memcpy name as requested by the
> redirection.
> Ok to commit?
> 2003-04-27  Jakub Jelinek  <jakub@redhat.com>
> 	* c-decl.c (finish_decl): When prototype with asmspec is found
> 	for built-in, adjust built_in_decls as well as expr.c decls.
> 	* expr.c (init_block_move_fn, init_block_clear_fn): New functions.
> 	(emit_block_move_libcall_fn, clear_storage_libcall_fn): Use it.
> 	* expr.c (init_block_move_fn, init_block_clear_fn): New prototypes.
> 	* builtins.def (BUILT_IN_BCOPY, BUILT_IN_MEMMOVE): New.
> 	* builtin-types.def (BT_FN_VOID_CONST_PTR_PTR_SIZE): New.
> 	* builtins.c (expand_builtin_memmove, expand_builtin_bcopy): New
> 	functions.
> 	(expand_builtin): Handle BUILT_IN_BCOPY and BUILT_IN_MEMMOVE.
> 	* gcc.c-torture/execute/string-opt-19.c: New test.
> 	* gcc.c-torture/execute/string-opt-asm-1.c: New test.
> 	* gcc.c-torture/execute/string-opt-asm-2.c: New test.

You've got two patches mixed up together here.  One is the change you
described, and another adds builtin bcopy and memmove.  Please split
it up.  The patch to add builtin bcopy and memmove, by itself, should
be uncontroversial, so please resubmit that one first.


More information about the Gcc-patches mailing list