gimplify.c (gimplify_modify_expr): Don't force a temporary of an aggregate_value_p...
authorJason Merrill <jason@redhat.com>
Fri, 11 Jun 2004 03:26:31 +0000 (23:26 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 11 Jun 2004 03:26:31 +0000 (23:26 -0400)
        * gimplify.c (gimplify_modify_expr): Don't force a temporary
        of an aggregate_value_p type.

From-SVN: r82959

gcc/ChangeLog
gcc/gimplify.c

index ca94a49eb60e04c77e95a8602de7b40198e11ab6..9628c84dffdfd7f9171b204a160f88ab4588c81f 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-10  Jason Merrill  <jason@redhat.com>
+
+       * gimplify.c (gimplify_modify_expr): Don't force a temporary
+       of an aggregate_value_p type.
+
 2004-06-10  Jeff Law  <law@redhat.com>
 
        * fold-const.c (fold_inf_compare): Avoid creating non-gimple
index c25a89171b3e52ea3dfcf8fbd269bdaa80039b90..a4b9c702e284dc0b6ae68152fc2e6415720bc0a8 100644 (file)
@@ -2493,12 +2493,16 @@ gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value)
 
         FIXME this should be handled by the is_gimple_rhs predicate.  */
 
-      if (TREE_CODE (*from_p) == CALL_EXPR
-         || (flag_non_call_exceptions && tree_could_trap_p (*from_p))
-         /* If we're dealing with a renamable type, either source or dest
-            must be a renamed variable.  */
-         || (is_gimple_reg_type (TREE_TYPE (*from_p))
-             && !is_gimple_reg (*to_p)))
+      if (aggregate_value_p (TREE_TYPE (*from_p), NULL_TREE))
+       /* Don't force a temp of a large aggregate type; the copy could be
+          arbitrarily expensive.  Instead we will generate a V_MAY_DEF for
+          the assignment.  */;
+      else if (TREE_CODE (*from_p) == CALL_EXPR
+              || (flag_non_call_exceptions && tree_could_trap_p (*from_p))
+              /* If we're dealing with a renamable type, either source or dest
+                 must be a renamed variable.  */
+              || (is_gimple_reg_type (TREE_TYPE (*from_p))
+                  && !is_gimple_reg (*to_p)))
        gimplify_expr (from_p, pre_p, post_p, is_gimple_val, fb_rvalue);
 
       /* If the value being copied is of variable width, expose the length