aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2004-08-11 06:28:00 +0000
committerZack Weinberg <zack@gcc.gnu.org>2004-08-11 06:28:00 +0000
commit6f4a43e029d1e36130a9ff55128a1d101cf32ec5 (patch)
tree89b4cb40824a7b6f34fb1a33c8593dbfdf639b5e /gcc/stmt.c
parent1a186ec5586436555a30227776d75c2516fd5911 (diff)
downloadgcc-6f4a43e029d1e36130a9ff55128a1d101cf32ec5.zip
gcc-6f4a43e029d1e36130a9ff55128a1d101cf32ec5.tar.gz
gcc-6f4a43e029d1e36130a9ff55128a1d101cf32ec5.tar.bz2
stmt.c (expand_return): If asked to return the RESULT_DECL, just call expand_value_return on result_rtl.
* stmt.c (expand_return): If asked to return the RESULT_DECL, just call expand_value_return on result_rtl. From-SVN: r85795
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 86d4fe9..9425cff 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1635,8 +1635,6 @@ expand_return (tree retval)
expand_null_return ();
return;
}
- else if (TREE_CODE (retval) == RESULT_DECL)
- retval_rhs = retval;
else if ((TREE_CODE (retval) == MODIFY_EXPR
|| TREE_CODE (retval) == INIT_EXPR)
&& TREE_CODE (TREE_OPERAND (retval, 0)) == RESULT_DECL)
@@ -1646,6 +1644,11 @@ expand_return (tree retval)
result_rtl = DECL_RTL (DECL_RESULT (current_function_decl));
+ /* If we are returning the RESULT_DECL, then the value has already
+ been stored into it, so we don't have to do anything special. */
+ if (TREE_CODE (retval_rhs) == RESULT_DECL)
+ expand_value_return (result_rtl);
+
/* If the result is an aggregate that is being returned in one (or more)
registers, load the registers here. The compiler currently can't handle
copying a BLKmode value into registers. We could put this code in a
@@ -1653,9 +1656,9 @@ expand_return (tree retval)
call/return), but until this feature is generally usable it is kept here
(and in expand_call). */
- if (retval_rhs != 0
- && TYPE_MODE (TREE_TYPE (retval_rhs)) == BLKmode
- && REG_P (result_rtl))
+ else if (retval_rhs != 0
+ && TYPE_MODE (TREE_TYPE (retval_rhs)) == BLKmode
+ && REG_P (result_rtl))
{
int i;
unsigned HOST_WIDE_INT bitpos, xbitpos;