[patch] Remove {LCT,ECF,REG}_ALWAYS_RETURN.

Kazu Hirata kazu@cs.umass.edu
Fri Feb 25 12:58:00 GMT 2005


Hi,

Attached is a patch to remove {LCT,ECF,REG}_ALWAYS_RETURN.

Currently, nobody uses LCT_ALWAYS_RETURN in any assignment.

Once we remove all uses of LCT_ALWAYS_RETURN, nobody uses
ECF_ALWAYS_RETURN in any assignment.

Once we remove all uses of ECF_ALWAYS_RETURN, nobody uses
REG_ALWAYS_RETURN in any assignment.

The patch removes all three of these flags and their uses.

LCT_ALWAYS_RETURN became unused with this patch

http://gcc.gnu.org/ml/gcc-patches/2004-03/msg01148.html

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

Kazu Hirata

2005-02-24  Kazu Hirata  <kazu@cs.umass.edu>

	* calls.c (emit_call_1): Don't use  REG_ALWAYS_RETURN.
	(emit_library_call_value_1): Don't use LCT_ALWAYS_RETURN and
	REG_ALWAYS_RETURN.
	* cfgrtl.c (need_fake_edge_p): Likewise.
	* combine.c (distribute_notes): Likewise.
	* emit-rtl.c (try_split): Likewise.
	* recog.c (peephole2_opimize): Likewise.
	* reg-notes.def (ALWAYS_RETURN): Remove.
	* rtl.h (LCT_ALWAYS_RETURN): Remove.
	* tree-cfg.c (need_fake_edge_p): Don't use ECF_ALWAYS_RETURN.
	* tree.h (ECF_ALWAYS_RETURN): Remove.

Index: calls.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/calls.c,v
retrieving revision 1.378
diff -u -d -p -r1.378 calls.c
--- calls.c	26 Jan 2005 15:08:50 -0000	1.378
+++ calls.c	24 Feb 2005 18:33:08 -0000
@@ -395,9 +395,6 @@ emit_call_1 (rtx funexp, tree fntree, tr
   if (ecf_flags & ECF_NORETURN)
     REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_NORETURN, const0_rtx,
 					       REG_NOTES (call_insn));
-  if (ecf_flags & ECF_ALWAYS_RETURN)
-    REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_ALWAYS_RETURN, const0_rtx,
-					       REG_NOTES (call_insn));
 
   if (ecf_flags & ECF_RETURNS_TWICE)
     {
@@ -3234,9 +3231,6 @@ emit_library_call_value_1 (int retval, r
     case LCT_THROW:
       flags = ECF_NORETURN;
       break;
-    case LCT_ALWAYS_RETURN:
-      flags = ECF_ALWAYS_RETURN;
-      break;
     case LCT_RETURNS_TWICE:
       flags = ECF_RETURNS_TWICE;
       break;
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.158
diff -u -d -p -r1.158 cfgrtl.c
--- cfgrtl.c	14 Feb 2005 11:37:52 -0000	1.158
+++ cfgrtl.c	24 Feb 2005 18:33:08 -0000
@@ -2892,7 +2892,6 @@ need_fake_edge_p (rtx insn)
   if ((CALL_P (insn)
        && !SIBLING_CALL_P (insn)
        && !find_reg_note (insn, REG_NORETURN, NULL)
-       && !find_reg_note (insn, REG_ALWAYS_RETURN, NULL)
        && !CONST_OR_PURE_CALL_P (insn)))
     return true;
 
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.475
diff -u -d -p -r1.475 combine.c
--- combine.c	12 Feb 2005 15:17:50 -0000	1.475
+++ combine.c	24 Feb 2005 18:33:12 -0000
@@ -11886,7 +11886,6 @@ distribute_notes (rtx notes, rtx from_in
 	    }
 	  break;
 
-	case REG_ALWAYS_RETURN:
 	case REG_NORETURN:
 	case REG_SETJMP:
 	  /* These notes must remain with the call.  It should not be
Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.434
diff -u -d -p -r1.434 emit-rtl.c
--- emit-rtl.c	18 Feb 2005 06:58:35 -0000	1.434
+++ emit-rtl.c	24 Feb 2005 18:33:16 -0000
@@ -3206,7 +3206,6 @@ try_split (rtx pat, rtx trial, int last)
 
 	case REG_NORETURN:
 	case REG_SETJMP:
-	case REG_ALWAYS_RETURN:
 	  insn = insn_last;
 	  while (insn != NULL_RTX)
 	    {
Index: recog.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/recog.c,v
retrieving revision 1.218
diff -u -d -p -r1.218 recog.c
--- recog.c	31 Jan 2005 21:14:44 -0000	1.218
+++ recog.c	24 Feb 2005 18:33:18 -0000
@@ -3070,7 +3070,6 @@ peephole2_optimize (FILE *dump_file ATTR
 			  {
 			  case REG_NORETURN:
 			  case REG_SETJMP:
-			  case REG_ALWAYS_RETURN:
 			    REG_NOTES (new_insn)
 			      = gen_rtx_EXPR_LIST (REG_NOTE_KIND (note),
 						   XEXP (note, 0),
Index: reg-notes.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reg-notes.def,v
retrieving revision 2.3
diff -u -d -p -r2.3 reg-notes.def
--- reg-notes.def	21 Sep 2004 20:34:43 -0000	2.3
+++ reg-notes.def	24 Feb 2005 18:33:18 -0000
@@ -167,6 +167,3 @@ REG_NOTE (CROSSING_JUMP)
 /* This kind of note is generated at each to `setjmp', and similar
    functions that can return twice.  */
 REG_NOTE (SETJMP)
-
-/* Indicate calls that always returns.  */
-REG_NOTE (ALWAYS_RETURN)
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.536
diff -u -d -p -r1.536 rtl.h
--- rtl.h	15 Feb 2005 07:19:51 -0000	1.536
+++ rtl.h	24 Feb 2005 18:33:18 -0000
@@ -2095,8 +2095,7 @@ enum libcall_type
   LCT_PURE_MAKE_BLOCK = 4,
   LCT_NORETURN = 5,
   LCT_THROW = 6,
-  LCT_ALWAYS_RETURN = 7,
-  LCT_RETURNS_TWICE = 8
+  LCT_RETURNS_TWICE = 7
 };
 
 extern void emit_library_call (rtx, enum libcall_type, enum machine_mode, int,
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.151
diff -u -d -p -r2.151 tree-cfg.c
--- tree-cfg.c	21 Feb 2005 18:38:05 -0000	2.151
+++ tree-cfg.c	24 Feb 2005 18:33:20 -0000
@@ -5327,7 +5327,7 @@ need_fake_edge_p (tree t)
   tree call;
 
   /* NORETURN and LONGJMP calls already have an edge to exit.
-     CONST, PURE and ALWAYS_RETURN calls do not need one.
+     CONST and PURE calls do not need one.
      We don't currently check for CONST and PURE here, although
      it would be a good idea, because those attributes are
      figured out from the RTL in mark_constant_function, and
@@ -5335,7 +5335,7 @@ need_fake_edge_p (tree t)
      leads to different results from -fbranch-probabilities.  */
   call = get_call_expr_in (t);
   if (call
-      && !(call_expr_flags (call) & (ECF_NORETURN | ECF_ALWAYS_RETURN)))
+      && !(call_expr_flags (call) & ECF_NORETURN))
     return true;
 
   if (TREE_CODE (t) == ASM_EXPR
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.692
diff -u -d -p -r1.692 tree.h
--- tree.h	14 Feb 2005 16:07:16 -0000	1.692
+++ tree.h	24 Feb 2005 18:33:22 -0000
@@ -3685,10 +3685,8 @@ extern rtx emit_line_note (location_t);
 /* Nonzero if this is a call to a function that returns with the stack
    pointer depressed.  */
 #define ECF_SP_DEPRESSED	256
-/* Nonzero if this call is known to always return.  */
-#define ECF_ALWAYS_RETURN	512
 /* Create libcall block around the call.  */
-#define ECF_LIBCALL_BLOCK	1024
+#define ECF_LIBCALL_BLOCK	512
 
 extern int flags_from_decl_or_type (tree);
 extern int call_expr_flags (tree);



More information about the Gcc-patches mailing list