]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/55630 (FAIL: g++.dg/pr48660.C -std=c++98 (internal compiler...
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 16 Dec 2012 10:02:37 +0000 (10:02 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 16 Dec 2012 10:02:37 +0000 (10:02 +0000)
PR rtl-optimization/55630
* expr.c (expand_assignment): Do not call copy_blkmode_to_reg to move
BLKmode return values to the return register.

From-SVN: r194530

gcc/ChangeLog
gcc/expr.c

index 4b5d926561ff512683969eb74c86edba4d4c7475..7156bc6a750f4f181e6062f85588467ad5412377 100644 (file)
@@ -1,3 +1,9 @@
+2012-12-16  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR rtl-optimization/55630
+       * expr.c (expand_assignment): Do not call copy_blkmode_to_reg to move
+       BLKmode return values to the return register.
+
 2012-12-15  Alexandre Oliva <aoliva@redhat.com>
 
        PR libmudflap/53952
index 7e86983d7558525ae35cfb52037b603a6cff2fe3..9d9e5b9abf59f265c3335aa28b72fa0a4895e0d8 100644 (file)
@@ -4947,7 +4947,12 @@ expand_assignment (tree to, tree from, bool nontemporal)
       rtx temp;
 
       push_temp_slots ();
-      if (REG_P (to_rtx) && TYPE_MODE (TREE_TYPE (from)) == BLKmode)
+
+      /* If the source is itself a return value, it still is in a pseudo at
+        this point so we can move it back to the return register directly.  */
+      if (REG_P (to_rtx)
+         && TYPE_MODE (TREE_TYPE (from)) == BLKmode
+         && TREE_CODE (from) != CALL_EXPR)
        temp = copy_blkmode_to_reg (GET_MODE (to_rtx), from);
       else
        temp = expand_expr (from, NULL_RTX, GET_MODE (to_rtx), EXPAND_NORMAL);