expr.c (expand_assignment): For BLKmode structure returns...
authorJeff Law <law@gcc.gnu.org>
Tue, 29 Nov 1994 05:44:19 +0000 (22:44 -0700)
committerJeff Law <law@gcc.gnu.org>
Tue, 29 Nov 1994 05:44:19 +0000 (22:44 -0700)
* expr.c (expand_assignment): For BLKmode structure returns,
copy the return value from registers into the target memory
locations.

From-SVN: r8575

gcc/expr.c

index d3726923f3d223bb18fda09f40f085e1be515ff3..57bf2ea4012379bcbe05e37026934651c810dc9c 100644 (file)
@@ -2549,7 +2549,14 @@ expand_assignment (to, from, want_value, suggest_reg)
       value = expand_expr (from, NULL_RTX, VOIDmode, 0);
       if (to_rtx == 0)
        to_rtx = expand_expr (to, NULL_RTX, VOIDmode, 0);
-      emit_move_insn (to_rtx, value);
+
+      if (GET_MODE (to_rtx) == BLKmode)
+       {
+         int align = MIN (TYPE_ALIGN (TREE_TYPE (from)), BITS_PER_WORD);
+         emit_block_move (to_rtx, value, expr_size (from), align);
+       }
+      else
+       emit_move_insn (to_rtx, value);
       preserve_temp_slots (to_rtx);
       free_temp_slots ();
       pop_temp_slots ();