OSDN Git Service

* reorg.c (dbr_schedule): Allow current_function_return_rtx
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Aug 1997 19:59:51 +0000 (19:59 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Aug 1997 19:59:51 +0000 (19:59 +0000)
        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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14972 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/function.c
gcc/reorg.c

index 6c84a01..93a2c91 100644 (file)
@@ -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
index d12db1e..644cc72 100644 (file)
@@ -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
index 93ae785..3686907 100644 (file)
@@ -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);