aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-05-15 07:21:37 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-05-15 07:21:37 +0000
commitf301837ea38782f232b7db3e1e0eb51a03819240 (patch)
tree9b15f75819db2c471bd87195d4830b892fc6bb39 /gcc/gimplify.c
parentaa44c80c8f41928efa6c8ccaeaadf6e602925e3b (diff)
downloadgcc-f301837ea38782f232b7db3e1e0eb51a03819240.zip
gcc-f301837ea38782f232b7db3e1e0eb51a03819240.tar.gz
gcc-f301837ea38782f232b7db3e1e0eb51a03819240.tar.bz2
gimplify.c (gimplify_init_constructor): Do a block move for very small objects as well.
* gimplify.c (gimplify_init_constructor): Do a block move for very small objects as well. From-SVN: r187498
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 02e42b8..d7f1f82 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4033,9 +4033,13 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
else
align = TYPE_ALIGN (type);
+ /* Do a block move either if the size is so small as to make
+ each individual move a sub-unit move on average, or if it
+ is so large as to make individual moves inefficient. */
if (size > 0
&& num_nonzero_elements > 1
- && !can_move_by_pieces (size, align))
+ && (size < num_nonzero_elements
+ || !can_move_by_pieces (size, align)))
{
if (notify_temp_creation)
return GS_ERROR;