diff options
author | Jakub Jelinek <jakub@redhat.com> | 2003-04-28 21:58:52 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2003-04-28 21:58:52 +0200 |
commit | 9661b15f951d61710cadd3b4c85d5b29078e116e (patch) | |
tree | 331faf76cb1d514411e5707a36e1f12f9c9dcbdb /gcc/c-decl.c | |
parent | 62a3446bb83d9c091ba650e10eb21fd9d4577cc1 (diff) | |
download | gcc-9661b15f951d61710cadd3b4c85d5b29078e116e.zip gcc-9661b15f951d61710cadd3b4c85d5b29078e116e.tar.gz gcc-9661b15f951d61710cadd3b4c85d5b29078e116e.tar.bz2 |
c-decl.c (finish_decl): When prototype with asmspec is found for built-in...
* 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.
* gcc.c-torture/execute/string-opt-asm-1.c: New test.
* gcc.c-torture/execute/string-opt-asm-2.c: New test.
From-SVN: r66181
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index ee98785..e16c2b6 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -2867,12 +2867,28 @@ finish_decl (decl, init, asmspec_tree) TREE_USED (decl) = 1; } - /* If this is a function and an assembler name is specified, it isn't - builtin any more. Also reset DECL_RTL so we can give it its new - name. */ + /* If this is a function and an assembler name is specified, reset DECL_RTL + so we can give it its new name. Also, update built_in_decls if it + was a normal built-in. */ if (TREE_CODE (decl) == FUNCTION_DECL && asmspec) { - DECL_BUILT_IN_CLASS (decl) = NOT_BUILT_IN; + if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL) + { + tree builtin = built_in_decls [DECL_FUNCTION_CODE (decl)]; + SET_DECL_RTL (builtin, NULL_RTX); + SET_DECL_ASSEMBLER_NAME (builtin, get_identifier (asmspec)); +#ifdef TARGET_MEM_FUNCTIONS + if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMCPY) + init_block_move_fn (asmspec); + else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMSET) + init_block_clear_fn (asmspec); +#else + if (DECL_FUNCTION_CODE (decl) == BUILT_IN_BCOPY) + init_block_move_fn (asmspec); + else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_BZERO) + init_block_clear_fn (asmspec); +#endif + } SET_DECL_RTL (decl, NULL_RTX); SET_DECL_ASSEMBLER_NAME (decl, get_identifier (asmspec)); } |