diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-05-27 14:56:31 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-05-27 14:56:31 -0400 |
commit | d720b9d197634ff2ac556cfb17b586c17b08f54a (patch) | |
tree | 97cfe692c0df086b77ca442dcbafe94bcecf8d35 /gcc/expr.c | |
parent | d0c84fdaa3b80b4ecb0c6f7afa44082b92fa457b (diff) | |
download | gcc-d720b9d197634ff2ac556cfb17b586c17b08f54a.zip gcc-d720b9d197634ff2ac556cfb17b586c17b08f54a.tar.gz gcc-d720b9d197634ff2ac556cfb17b586c17b08f54a.tar.bz2 |
(expand_expr...
(expand_expr, case CONSTRUCTOR): If constant and large enough for
memcpy to be used, build constructor into static memory.
From-SVN: r7365
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -4102,12 +4102,18 @@ expand_expr (exp, target, tmode, modifier) if this is a non-BLKmode mode, let it store a field at a time since that should make a CONST_INT or CONST_DOUBLE when we fold. Likewise, if we have a target we can use, it is best to - store directly into the target. If we are making an initializer and + store directly into the target unless the type is large enough + that memcpy will be used. If we are making an initializer and all operands are constant, put it in memory as well. */ else if ((TREE_STATIC (exp) && ((mode == BLKmode && ! (target != 0 && safe_from_p (target, exp))) - || TREE_ADDRESSABLE (exp))) + || TREE_ADDRESSABLE (exp) + || (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST + && (move_by_pieces_ninsns + (TREE_INT_CST_LOW (TYPE_SIZE (type)), + TYPE_ALIGN (type)) + > MOVE_RATIO)))) || (modifier == EXPAND_INITIALIZER && TREE_CONSTANT (exp))) { rtx constructor = output_constant_def (exp); |