diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2004-08-11 06:28:00 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2004-08-11 06:28:00 +0000 |
commit | 6f4a43e029d1e36130a9ff55128a1d101cf32ec5 (patch) | |
tree | 89b4cb40824a7b6f34fb1a33c8593dbfdf639b5e /gcc/stmt.c | |
parent | 1a186ec5586436555a30227776d75c2516fd5911 (diff) | |
download | gcc-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.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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; |