diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-11 06:28:00 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-11 06:28:00 +0000 |
commit | 6f4df69dad7e128f3b28f5840748a53f7acefb12 (patch) | |
tree | 89b4cb40824a7b6f34fb1a33c8593dbfdf639b5e /gcc/stmt.c | |
parent | afcf285eb542beb5277cd17c3f0ef4d3b525bb10 (diff) | |
download | gcc-6f4df69dad7e128f3b28f5840748a53f7acefb12.tar.gz |
* stmt.c (expand_return): If asked to return the RESULT_DECL,
just call expand_value_return on result_rtl.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85795 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c index 86d4fe98dd3..9425cffc89e 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; |