re PR target/11787 (always call memcpy for block move in mips16)
authorSandra Loosemore <sandra@codesourcery.com>
Fri, 24 Aug 2007 23:54:05 +0000 (19:54 -0400)
committerSandra Loosemore <sandra@gcc.gnu.org>
Fri, 24 Aug 2007 23:54:05 +0000 (19:54 -0400)
commitcfa311506c8dbc85b11fd7e52f3d177d850e1c11
tree6895f19a8975ec8b4b0758ed56b3ed5a18bd56e7
parentf9837879d58101f62cd52cc7d17b5dd76b975978
re PR target/11787 (always call memcpy for block move in mips16)

2007-08-24  Sandra Loosemore  <sandra@codesourcery.com>
            Nigel Stephens <nigel@mips.com>

PR target/11787

gcc/

* doc/tm.texi (SET_RATIO, SET_BY_PIECES_P): Document new macros.
(STORE_BY_PIECES_P): No longer applies to __builtin_memset.
* expr.c (SET_BY_PIECES_P): Define.
(can_store_by_pieces, store_by_pieces): Add MEMSETP argument; use
it to decide whether to use SET_BY_PIECES_P or STORE_BY_PIECES_P.
(store_expr):  Pass MEMSETP argument to can_store_by_pieces and
store_by_pieces.
* expr.h (SET_RATIO): Define.
(can_store_by_pieces, store_by_pieces): Update prototypes.
* builtins.c (expand_builtin_memcpy): Pass MEMSETP argument to
can_store_by_pieces/store_by_pieces.
(expand_builtin_memcpy_args): Likewise.
(expand_builtin_strncpy): Likewise.
(expand_builtin_memset_args): Likewise.  Also remove special case
for optimize_size so that can_store_by_pieces/SET_BY_PIECES_P can
decide what to do instead.
* value-prof.c (tree_stringops_transform): Pass MEMSETP argument
to can_store_by_pieces.

* config/sh/sh.h (SET_BY_PIECES_P): Clone from STORE_BY_PIECES_P.
* config/s390/s390.h (SET_BY_PIECES_P): Likewise.

* config/mips/mips.opt (mmemcpy): Change from Var to Mask.
* config/mips/mips.c (override_options): Make -Os default to -mmemcpy.
* config/mips/mips.h (MIPS_CALL_RATIO): Define.
(MOVE_RATIO, CLEAR_RATIO, SET_RATIO): Define.
(STORE_BY_PIECES_P): Define.

Co-Authored-By: Nigel Stephens <nigel@mips.com>
From-SVN: r127790
gcc/ChangeLog
gcc/builtins.c
gcc/config/mips/mips.c
gcc/config/mips/mips.h
gcc/config/mips/mips.opt
gcc/config/s390/s390.h
gcc/config/sh/sh.h
gcc/doc/tm.texi
gcc/expr.c
gcc/expr.h
gcc/value-prof.c