]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gimplify.c (gimplify_init_constructor): Do a block move for very small objects as...
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 15 May 2012 07:21:37 +0000 (07:21 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 15 May 2012 07:21:37 +0000 (07:21 +0000)
* gimplify.c (gimplify_init_constructor): Do a block move for very
small objects as well.

From-SVN: r187498

gcc/ChangeLog
gcc/gimplify.c

index df9f0dc09da9dd6d3b51f8c9734e486ce9d0f8ef..e2f6509e0df7510cfd94eff67b8fc11ec0434fdd 100644 (file)
@@ -1,3 +1,8 @@
+2012-05-15  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gimplify.c (gimplify_init_constructor): Do a block move for very
+       small objects as well.
+
 2012-05-15  Bernd Schmidt  <bernds@codesourcery.com>
 
        * ira.c (find_moveable_pseudos): Skip registers whose
index 02e42b8b419831984f0179aa07772086ec6c56ea..d7f1f82345b874ea99fb915c126eefe805199c8f 100644 (file)
@@ -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;