aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1997-08-27 19:59:51 +0000
committerJeff Law <law@gcc.gnu.org>1997-08-27 13:59:51 -0600
commitf345de42fc8437a8742aa40cf865de357b21e37f (patch)
tree7d1359bf6a618db548e998e24f753e012f4a0dbd /gcc
parent67f68fd265af43b2ebeb3d478f71da0389763a98 (diff)
downloadgcc-f345de42fc8437a8742aa40cf865de357b21e37f.zip
gcc-f345de42fc8437a8742aa40cf865de357b21e37f.tar.gz
gcc-f345de42fc8437a8742aa40cf865de357b21e37f.tar.bz2
reorg.c (dbr_schedule): Allow current_function_return_rtx to be something other than a REG.
* reorg.c (dbr_schedule): Allow current_function_return_rtx to be something other than a REG. * function.c (expand_function_end): Fix current_function_return_rtx if it was a pseudo. Brought over from the fsf/devo. From-SVN: r14972
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/function.c13
-rw-r--r--gcc/reorg.c3
3 files changed, 15 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6c84a01..93a2c91 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -29,6 +29,11 @@ Wed Aug 27 01:24:25 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
Wed Aug 27 00:49:14 1997 Jeffrey A Law (law@cygnus.com)
+ * reorg.c (dbr_schedule): Allow current_function_return_rtx
+ to be something other than a REG.
+ * function.c (expand_function_end): Fix current_function_return_rtx
+ if it was a pseudo.
+
* t-freebsd (USER_H): Include EXTRA_HEADERS and LANG_EXTRA_HEADERS.
* x-netbsd: Likewise
* x-dgux (USER_H): Include EXTRA_HEADERS and LANG_EXTRA_HEADERS
diff --git a/gcc/function.c b/gcc/function.c
index d12db1e..644cc72 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -191,10 +191,10 @@ CUMULATIVE_ARGS current_function_args_info;
char *current_function_name;
-/* If non-zero, an RTL expression for that location at which the current
- function returns its result. Always equal to
- DECL_RTL (DECL_RESULT (current_function_decl)), but provided
- independently of the tree structures. */
+/* If non-zero, an RTL expression for the location at which the current
+ function returns its result. If the current function returns its
+ result in a register, current_function_return_rtx will always be
+ the hard register containing the result. */
rtx current_function_return_rtx;
@@ -5692,6 +5692,11 @@ expand_function_end (filename, line, end_bindings)
emit_move_insn (real_decl_result,
DECL_RTL (DECL_RESULT (current_function_decl)));
emit_insn (gen_rtx (USE, VOIDmode, real_decl_result));
+
+ /* The delay slot scheduler assumes that current_function_return_rtx
+ holds the hard register containing the return value, not a temporary
+ pseudo. */
+ current_function_return_rtx = real_decl_result;
}
/* If returning a structure, arrange to return the address of the value
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 93ae785..3686907 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -4492,8 +4492,7 @@ dbr_schedule (first, file)
else
SET_HARD_REG_BIT (end_of_function_needs.regs, STACK_POINTER_REGNUM);
- if (current_function_return_rtx != 0
- && GET_CODE (current_function_return_rtx) == REG)
+ if (current_function_return_rtx != 0)
mark_referenced_resources (current_function_return_rtx,
&end_of_function_needs, 1);