This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] function.c, stmt.c: Remove two "if"s that always trigger.


Hi,

Attached is a patch to remove two "if"s that always trigger.

These days we always create a return_label in
function.c:expand_function_start, so we don't need to check if
return_label is nonnull.

Tested on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2004-11-11  Kazu Hirata  <kazu@cs.umass.edu>

	* function.c (expand_function_end): Remove an "if" statement
	that always trigger.
	* stmt.c (expand_null_return_1): Likewise.

Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.586
diff -u -d -p -r1.586 function.c
--- function.c	9 Nov 2004 19:19:40 -0000	1.586
+++ function.c	11 Nov 2004 04:16:30 -0000
@@ -4317,13 +4317,8 @@ expand_function_end (void)
      is computed.  */
   clobber_after = get_last_insn ();
 
-  /* Output the label for the actual return from the function,
-     if one is expected.  This happens either because a function epilogue
-     is used instead of a return instruction, or because a return was done
-     with a goto in order to run local cleanups, or because of pcc-style
-     structure returning.  */
-  if (return_label)
-    emit_label (return_label);
+  /* Output the label for the actual return from the function.  */
+  emit_label (return_label);
 
   /* Let except.c know where it should emit the call to unregister
      the function context for sjlj exceptions.  */
Index: stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stmt.c,v
retrieving revision 1.408
diff -u -d -p -r1.408 stmt.c
--- stmt.c	4 Nov 2004 23:28:27 -0000	1.408
+++ stmt.c	11 Nov 2004 04:16:31 -0000
@@ -1564,15 +1564,9 @@ expand_value_return (rtx val)
 static void
 expand_null_return_1 (void)
 {
-  rtx end_label;
-
   clear_pending_stack_adjust ();
   do_pending_stack_adjust ();
-
-  end_label = return_label;
-  if (end_label == 0)
-     end_label = return_label = gen_label_rtx ();
-  emit_jump (end_label);
+  emit_jump (return_label);
 }
 
 /* Generate RTL to evaluate the expression RETVAL and return it


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]