diff options
author | Jakub Jelinek <jakub@redhat.com> | 2003-06-03 10:57:55 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2003-06-03 10:57:55 +0200 |
commit | 8fd3cf4e17c97036b4f9cecbe2f438a2da920351 (patch) | |
tree | 969f8e454fe8799c43c000ed725898b0593270ff /gcc/expr.h | |
parent | cc6a602b278d597095052e6de06f02d65b315a03 (diff) | |
download | gcc-8fd3cf4e17c97036b4f9cecbe2f438a2da920351.zip gcc-8fd3cf4e17c97036b4f9cecbe2f438a2da920351.tar.gz gcc-8fd3cf4e17c97036b4f9cecbe2f438a2da920351.tar.bz2 |
builtins.c (expand_builtin_memcpy): Remove endp argument and endp != 0 handling.
* builtins.c (expand_builtin_memcpy): Remove endp argument and endp
!= 0 handling. Pass 0 to store_by_pieces.
(expand_builtin_mempcpy): Add endp argument. Don't call
expand_builtin_memcpy, call store_by_pieces resp. move_by_pieces
directly. If ignoring result, only do expand_call.
(expand_builtin_stpcpy): Likewise. Call expand_builtin_mempcpy
otherwise.
(expand_builtin_strncpy, expand_builtin_memset): Adjust
store_by_pices callers.
(expand_builtin): Adjust expand_builtin_memcpy and
expand_builtin_mempcpy callers.
* expr.c (can_move_by_pieces): New function.
(move_by_pieces): Add endp argument, return to resp. memory at end
or one byte earlier depending on endp.
(store_by_pieces): Likewise.
(emit_block_move): Adjust call to move_by_pieces.
(emit_push_insn): Adjust move_by_pieces caller.
* expr.h (can_move_by_pieces): New prototype.
(store_by_pieces): Adjust prototypes.
* rtl.h (move_by_pieces): Adjust prototype.
* config/mips/mips.c (expand_block_move): Adjust move_by_pieces
caller.
* gcc.c-torture/execute/builtins/string-4.c (main_test): Remove
mempcpy test with post-increments.
* gcc.c-torture/execute/string-opt-3.c: New test.
* gcc.dg/string-opt-1.c: New test.
From-SVN: r67358
Diffstat (limited to 'gcc/expr.h')
-rw-r--r-- | gcc/expr.h | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -450,6 +450,11 @@ extern void use_group_regs PARAMS ((rtx *, rtx)); If OBJECT has BLKmode, SIZE is its length in bytes. */ extern rtx clear_storage PARAMS ((rtx, rtx)); +/* Determine whether the LEN bytes can be moved by using several move + instructions. Return nonzero if a call to move_by_pieces should + succeed. */ +extern int can_move_by_pieces PARAMS ((unsigned HOST_WIDE_INT, unsigned int)); + /* Return nonzero if it is desirable to store LEN bytes generated by CONSTFUN with several move instructions by store_by_pieces function. CONSTFUNDATA is a pointer which will be passed as argument @@ -463,11 +468,12 @@ extern int can_store_by_pieces PARAMS ((unsigned HOST_WIDE_INT, /* Generate several move instructions to store LEN bytes generated by CONSTFUN to block TO. (A MEM rtx with BLKmode). CONSTFUNDATA is a pointer which will be passed as argument in every CONSTFUN call. - ALIGN is maximum alignment we can assume. */ -extern void store_by_pieces PARAMS ((rtx, unsigned HOST_WIDE_INT, - rtx (*) (PTR, HOST_WIDE_INT, - enum machine_mode), - PTR, unsigned int)); + ALIGN is maximum alignment we can assume. + Returns TO + LEN. */ +extern rtx store_by_pieces PARAMS ((rtx, unsigned HOST_WIDE_INT, + rtx (*) (PTR, HOST_WIDE_INT, + enum machine_mode), + PTR, unsigned int, int)); /* Emit insns to set X from Y. */ extern rtx emit_move_insn PARAMS ((rtx, rtx)); |