]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
stmt.c (expand_null_return_1): Remove code to generate simple returns and "use_goto...
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>
Fri, 10 Aug 2001 02:14:26 +0000 (02:14 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Fri, 10 Aug 2001 02:14:26 +0000 (02:14 +0000)
* stmt.c (expand_null_return_1): Remove code to generate simple returns
and "use_goto" argument.
(expand_null_return, expand_value_return): Update all callers.
* function.c (expand_function_end): Remove code to generate simple
return.
* config/vax/vax.md (epilogue): New expander for function return.
* doc/md.texi (epilogue): Remove "if defined".

From-SVN: r44750

gcc/ChangeLog
gcc/config/vax/vax.md
gcc/doc/md.texi
gcc/function.c
gcc/stmt.c

index 33a8b9e91f39076509719d22df71a03a97d29f35..94412ee40669254d9a0dce828e17afba2b3b8da7 100644 (file)
@@ -1,3 +1,13 @@
+2001-08-09  John David Anglin  <dave@hiauly1.hia.nrc.ca>
+
+       * stmt.c (expand_null_return_1): Remove code to generate simple returns 
+       and "use_goto" argument.
+       (expand_null_return, expand_value_return): Update all callers.
+       * function.c (expand_function_end): Remove code to generate simple
+       return.
+       * config/vax/vax.md (epilogue): New expander for function return.
+       * doc/md.texi (epilogue): Remove "if defined".
+
 2001-08-09  Zack Weinberg  <zackw@stanford.edu>
 
        * Makefile.in: Partially revert my previous change:
index efff55aa59e4671e8809eafd823e84dd7caabc42..0f976c7b952cc992bb7827ac127068f986b6a32e 100644 (file)
   ""
   "ret")
 
+(define_expand "epilogue"
+  [(return)]
+  ""
+  "
+{
+  emit_jump_insn (gen_return ());
+  DONE;
+}")
+
 (define_insn "nop"
   [(const_int 0)]
   ""
index 8fa221deda3c6133dc02f721b5090977c3612477..f395d6f79671e0dfa4f8dbb0a773ab2f338bbb41 100644 (file)
@@ -2966,7 +2966,7 @@ instruction scheduling.
 @cindex @code{epilogue} instruction pattern
 @anchor{epilogue instruction pattern}
 @item @samp{epilogue}
-This pattern, if defined, emits RTL for exit from a function.  The function
+This pattern emits RTL for exit from a function.  The function
 exit is responsible for deallocating the stack frame, restoring callee saved
 registers and emitting the return instruction.
 
index f344cb53fdb70c06f73296eb27ae1c738e630851..af1c87befb68fbb4f5f7fb413713ac3a867194a8 100644 (file)
@@ -7016,18 +7016,6 @@ expand_function_end (filename, line, end_bindings)
      instead of using the general framework.  */
   use_return_register ();
 
-  /* Output a return insn if we are using one.
-     Otherwise, let the rtl chain end here, to drop through
-     into the epilogue.  */
-
-#ifdef HAVE_return
-  if (HAVE_return)
-    {
-      emit_jump_insn (gen_return ());
-      emit_barrier ();
-    }
-#endif
-
   /* Fix up any gotos that jumped out to the outermost
      binding level of the function.
      Must follow emitting RETURN_LABEL.  */
index 169291656d98151a0b039e069737104a4a7ee535..e9f044a73d833dc33a9c7ce38cab34299f6c3548 100644 (file)
@@ -403,7 +403,7 @@ static void expand_nl_goto_receiver PARAMS ((void));
 static void expand_nl_goto_receivers   PARAMS ((struct nesting *));
 static void fixup_gotos                        PARAMS ((struct nesting *, rtx, tree,
                                               rtx, int));
-static void expand_null_return_1       PARAMS ((rtx, int));
+static void expand_null_return_1       PARAMS ((rtx));
 static void expand_value_return                PARAMS ((rtx));
 static int tail_recursion_args         PARAMS ((tree, tree));
 static void expand_cleanups            PARAMS ((tree, tree, int, int));
@@ -2864,7 +2864,6 @@ expand_exit_something ()
 void
 expand_null_return ()
 {
-  struct nesting *block = block_stack;
   rtx last_insn = get_last_insn ();
 
   /* If this function was declared to return a value, but we
@@ -2872,13 +2871,7 @@ expand_null_return ()
      propogated live to the rest of the function.  */
   clobber_return_register ();
 
-  /* Does any pending block have cleanups?  */
-  while (block && block->data.block.cleanups == 0)
-    block = block->next;
-
-  /* If yes, use a goto to return, since that runs cleanups.  */
-
-  expand_null_return_1 (last_insn, block != 0);
+  expand_null_return_1 (last_insn);
 }
 
 /* Generate RTL to return from the current function, with value VAL.  */
@@ -2887,7 +2880,6 @@ static void
 expand_value_return (val)
      rtx val;
 {
-  struct nesting *block = block_stack;
   rtx last_insn = get_last_insn ();
   rtx return_reg = DECL_RTL (DECL_RESULT (current_function_decl));
 
@@ -2914,27 +2906,15 @@ expand_value_return (val)
        emit_move_insn (return_reg, val);
     }
 
-  /* Does any pending block have cleanups?  */
-
-  while (block && block->data.block.cleanups == 0)
-    block = block->next;
-
-  /* If yes, use a goto to return, since that runs cleanups.
-     Use LAST_INSN to put cleanups *before* the move insn emitted above.  */
-
-  expand_null_return_1 (last_insn, block != 0);
+  expand_null_return_1 (last_insn);
 }
 
 /* Output a return with no value.  If LAST_INSN is nonzero,
-   pretend that the return takes place after LAST_INSN.
-   If USE_GOTO is nonzero then don't use a return instruction;
-   go to the return label instead.  This causes any cleanups
-   of pending blocks to be executed normally.  */
+   pretend that the return takes place after LAST_INSN.  */
 
 static void
-expand_null_return_1 (last_insn, use_goto)
+expand_null_return_1 (last_insn)
      rtx last_insn;
-     int use_goto;
 {
   rtx end_label = cleanup_label ? cleanup_label : return_label;
 
@@ -2942,27 +2922,8 @@ expand_null_return_1 (last_insn, use_goto)
   do_pending_stack_adjust ();
   last_expr_type = 0;
 
-  /* PCC-struct return always uses an epilogue.  */
-  if (current_function_returns_pcc_struct || use_goto)
-    {
-      if (end_label == 0)
-       end_label = return_label = gen_label_rtx ();
-      expand_goto_internal (NULL_TREE, end_label, last_insn);
-      return;
-    }
-
-  /* Otherwise output a simple return-insn if one is available,
-     unless it won't do the job.  */
-#ifdef HAVE_return
-  if (HAVE_return && use_goto == 0 && cleanup_label == 0)
-    {
-      emit_jump_insn (gen_return ());
-      emit_barrier ();
-      return;
-    }
-#endif
-
-  /* Otherwise jump to the epilogue.  */
+  if (end_label == 0)
+     end_label = return_label = gen_label_rtx ();
   expand_goto_internal (NULL_TREE, end_label, last_insn);
 }
 \f