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] Remove CASE_DROPS_THROUGH


Hi,

This silly macro that was only used by the VAX backend
is now completely unused, so we can remove it.

Bootstrapped and tested on x86_64-unknown-linux-gnu.
OK?

Gr.
Steven



	* cfgcleanup.c (outgoing_edges_match, try_crossjump_to_edge):
	Remove CASE_DROPS_THROUGH checks, it is never defined.
	* cfglyout.c (fixup_reorder_chain): Likewise.
	* cfgrtl.c (rtl_verify_flow_info): Likewise.
	* stmt.c (expand_case): Likewise.
	* cfgbuild.c (make_edges): Likewise.  Also remove force_fallthru,
	it is now always 0.
	* system.h (CASE_DROPS_THROUGH): Poison.
	* doc/md.texi (casesi): Remove documentation of CASE_DROPS_THROUGH.
	* doc/tm.texi (casesi): Remove documentation of CASE_DROPS_THROUGH.

	* config/v850/v850.h: Remove commented out CASE_DROPS_THROUGH.

Index: cfgbuild.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgbuild.c,v
retrieving revision 1.56
diff -u -3 -p -r1.56 cfgbuild.c
--- cfgbuild.c	22 Nov 2004 17:13:59 -0000	1.56
+++ cfgbuild.c	29 Nov 2004 10:16:01 -0000
@@ -269,7 +269,6 @@ make_edges (basic_block min, basic_block
     {
       rtx insn, x;
       enum rtx_code code;
-      int force_fallthru = 0;
       edge e;
 
       if (LABEL_P (BB_HEAD (bb))
@@ -320,12 +319,6 @@ make_edges (basic_block min, basic_block
 		  && GET_CODE (XEXP (SET_SRC (tmp), 2)) == LABEL_REF)
 		make_label_edge (edge_cache, bb,
 				 XEXP (XEXP (SET_SRC (tmp), 2), 0), 0);
-
-#ifdef CASE_DROPS_THROUGH
-	      /* Silly VAXen.  The ADDR_VEC is going to be in the way of
-		 us naturally detecting fallthru into the next block.  */
-	      force_fallthru = 1;
-#endif
 	    }
 
 	  /* If this is a computed jump, then mark it as reaching
@@ -398,11 +391,11 @@ make_edges (basic_block min, basic_block
 	     && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK)
 	insn = NEXT_INSN (insn);
 
-      if (!insn || (bb->next_bb == EXIT_BLOCK_PTR && force_fallthru))
+      if (!insn)
 	cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR, EDGE_FALLTHRU);
       else if (bb->next_bb != EXIT_BLOCK_PTR)
 	{
-	  if (force_fallthru || insn == BB_HEAD (bb->next_bb))
+	  if (insn == BB_HEAD (bb->next_bb))
 	    cached_make_edge (edge_cache, bb, bb->next_bb, EDGE_FALLTHRU);
 	}
     }
Index: cfgcleanup.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgcleanup.c,v
retrieving revision 1.137
diff -u -3 -p -r1.137 cfgcleanup.c
--- cfgcleanup.c	22 Nov 2004 12:23:43 -0000	1.137
+++ cfgcleanup.c	29 Nov 2004 10:16:02 -0000
@@ -1353,7 +1353,6 @@ outgoing_edges_match (int mode, basic_bl
   /* Generic case - we are seeing a computed jump, table jump or trapping
      instruction.  */
 
-#ifndef CASE_DROPS_THROUGH
   /* Check whether there are tablejumps in the end of BB1 and BB2.
      Return true if they are identical.  */
     {
@@ -1427,7 +1426,6 @@ outgoing_edges_match (int mode, basic_bl
 	  return false;
 	}
     }
-#endif
 
   /* First ensure that the instructions match.  There may be many outgoing
      edges so this test is generally cheaper.  */
@@ -1565,7 +1563,6 @@ try_crossjump_to_edge (int mode, edge e1
       && (newpos1 != BB_HEAD (src1)))
     return false;
 
-#ifndef CASE_DROPS_THROUGH
   /* Here we know that the insns in the end of SRC1 which are common with SRC2
      will be deleted.
      If we have tablejumps in the end of SRC1 and SRC2
@@ -1596,7 +1593,6 @@ try_crossjump_to_edge (int mode, edge e1
 	    }
 	}
     }
-#endif
 
   /* Avoid splitting if possible.  */
   if (newpos2 == BB_HEAD (src2))
Index: cfglayout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfglayout.c,v
retrieving revision 1.78
diff -u -3 -p -r1.78 cfglayout.c
--- cfglayout.c	25 Nov 2004 09:29:59 -0000	1.78
+++ cfglayout.c	29 Nov 2004 10:16:02 -0000
@@ -739,21 +739,11 @@ fixup_reorder_chain (void)
 	    }
 	  else
 	    {
-#ifndef CASE_DROPS_THROUGH
 	      /* Otherwise we have some return, switch or computed
 		 jump.  In the 99% case, there should not have been a
 		 fallthru edge.  */
 	      gcc_assert (returnjump_p (bb_end_insn) || !e_fall);
 	      continue;
-#else
-	      if (returnjump_p (bb_end_insn) || !e_fall)
-		continue;
-	      /* Except for VAX.  Since we didn't have predication for the
-		 tablejump, the fallthru block should not have moved.  */
-	      if (bb->rbi->next == e_fall->dest)
-		continue;
-	      bb_end_insn = skip_insns_after_block (bb);
-#endif
 	    }
 	}
       else
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.152
diff -u -3 -p -r1.152 cfgrtl.c
--- cfgrtl.c	26 Nov 2004 06:54:13 -0000	1.152
+++ cfgrtl.c	29 Nov 2004 10:16:03 -0000
@@ -2197,13 +2197,7 @@ rtl_verify_flow_info (void)
 	  else
 	    for (insn = NEXT_INSN (BB_END (e->src)); insn != BB_HEAD (e->dest);
 		 insn = NEXT_INSN (insn))
-	      if (BARRIER_P (insn)
-#ifndef CASE_DROPS_THROUGH
-		  || INSN_P (insn)
-#else
-		  || (INSN_P (insn) && ! JUMP_TABLE_DATA_P (insn))
-#endif
-		  )
+	      if (BARRIER_P (insn) || INSN_P (insn))
 		{
 		  error ("verify_flow_info: Incorrect fallthru %i->%i",
 			 e->src->index, e->dest->index);
Index: stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stmt.c,v
retrieving revision 1.410
diff -u -3 -p -r1.410 stmt.c
--- stmt.c	24 Nov 2004 18:50:20 -0000	1.410
+++ stmt.c	29 Nov 2004 10:16:04 -0000
@@ -2553,14 +2553,8 @@ expand_case (tree exp)
 	    emit_jump_insn (gen_rtx_ADDR_VEC (CASE_VECTOR_MODE,
 					      gen_rtvec_v (ncases, labelvec)));
 
-	  /* If the case insn drops through the table,
-	     after the table we must jump to the default-label.
-	     Otherwise record no drop-through after the table.  */
-#ifdef CASE_DROPS_THROUGH
-	  emit_jump (default_label);
-#else
+	  /* Record no drop-through after the table.  */
 	  emit_barrier ();
-#endif
 	}
 
       before_case = NEXT_INSN (before_case);
Index: system.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/system.h,v
retrieving revision 1.237
diff -u -3 -p -r1.237 system.h
--- system.h	24 Nov 2004 08:39:32 -0000	1.237
+++ system.h	29 Nov 2004 10:16:04 -0000
@@ -658,7 +658,8 @@ extern void fancy_abort (const char *, i
 	GDB_INV_REF_REGPARM_STABS_LETTER DBX_MEMPARM_STABS_LETTER	   \
 	PUT_SDB_SRC_FILE STABS_GCC_MARKER DBX_OUTPUT_FUNCTION_END	   \
 	DBX_OUTPUT_GCC_MARKER DBX_FINISH_SYMBOL SDB_GENERATE_FAKE	   \
-	NON_SAVING_SETJMP TARGET_LATE_RTL_PROLOGUE_EPILOGUE
+	NON_SAVING_SETJMP TARGET_LATE_RTL_PROLOGUE_EPILOGUE		   \
+	CASE_DROPS_THROUGH
 
 /* Hooks that are no longer used.  */
  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE	\
Index: config/v850/v850.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/v850/v850.h,v
retrieving revision 1.98
diff -u -3 -p -r1.98 v850.h
--- config/v850/v850.h	8 Sep 2004 18:45:20 -0000	1.98
+++ config/v850/v850.h	29 Nov 2004 10:16:06 -0000
@@ -1240,11 +1240,6 @@ zbss_section ()								\
    for the index in the tablejump instruction.  */
 #define CASE_VECTOR_MODE (TARGET_BIG_SWITCH ? SImode : HImode)
 
-/* Define this if the case instruction drops through after the table
-   when the index is out of range.  Don't define it if the case insn
-   jumps to the default label instead.  */
-/* #define CASE_DROPS_THROUGH */
-
 /* Define as C expression which evaluates to nonzero if the tablejump
    instruction expects the table to contain offsets from the address of the
    table.
Index: doc/md.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/md.texi,v
retrieving revision 1.119
diff -u -3 -p -r1.119 md.texi
--- doc/md.texi	13 Nov 2004 22:28:46 -0000	1.119
+++ doc/md.texi	29 Nov 2004 10:16:09 -0000
@@ -3500,11 +3500,6 @@ A label that precedes the table itself.
 
 @item
 A label to jump to if the index has a value outside the bounds.
-(If the machine-description macro @code{CASE_DROPS_THROUGH} is defined,
-then an out-of-bounds index drops through to the code following
-the jump table instead of jumping to this label.  In that case,
-this label is not actually used by the @samp{casesi} instruction,
-but it is always provided as an operand.)
 @end enumerate
 
 The table is a @code{addr_vec} or @code{addr_diff_vec} inside of a
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.398
diff -u -3 -p -r1.398 tm.texi
--- doc/tm.texi	26 Nov 2004 19:21:16 -0000	1.398
+++ doc/tm.texi	29 Nov 2004 10:16:14 -0000
@@ -8717,12 +8717,6 @@ contain relative addresses only when @op
 is in effect.
 @end defmac
 
-@defmac CASE_DROPS_THROUGH
-Define this if control falls through a @code{case} insn when the index
-value is out of range.  This means the specified default-label is
-actually ignored by the @code{case} insn proper.
-@end defmac
-
 @defmac CASE_VALUES_THRESHOLD
 Define this to be the smallest number of different values for which it
 is best to use a jump-table instead of a tree of conditional branches.


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