From 124d58a1566656489e1a34297499ddec51df6eb3 Mon Sep 17 00:00:00 2001
From: mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 3 Aug 2000 00:17:11 +0000
Subject: [PATCH] 	* dce.c: Remove all uses of assert. 	* dwarf2out.c:
 Likewise. 	* dwarfout.c: Likewise. 	* ssa.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35438 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog   |  7 +++++++
 gcc/dce.c       | 31 ++++++++++++++++---------------
 gcc/dwarf2out.c | 12 ++----------
 gcc/dwarfout.c  |  9 ---------
 gcc/ssa.c       | 12 ++----------
 5 files changed, 27 insertions(+), 44 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0c3e56d4e941..9d27b95bf95a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2000-08-02  Mark Mitchell  <mark@codesourcery.com>
+
+	* dce.c: Remove all uses of assert.
+	* dwarf2out.c: Likewise.
+	* dwarfout.c: Likewise.
+	* ssa.c: Likewise.
+
 2000-08-02  Zack Weinberg  <zack@wolery.cumb.org>
 
 	* gcc.h (lang_specific_driver): Constify second argument.
diff --git a/gcc/dce.c b/gcc/dce.c
index f385afd31ea3..ddd2cd0c145c 100644
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -77,14 +77,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "recog.h"
 #include "output.h"
 
-/* We cannot use <assert.h> in GCC source, since that would include
-   GCC's assert.h, which may not be compatible with the host compiler.  */
-#undef assert
-#ifdef NDEBUG
-# define assert(e)
-#else
-# define assert(e) do { if (! (e)) abort (); } while (0)
-#endif
 
 /* A map from blocks to the edges on which they are control dependent.  */
 typedef struct {
@@ -186,7 +178,9 @@ set_control_dependent_block_to_edge_map_bit (c, bb, edge_index)
      basic_block bb;
      int edge_index;
 {
-  assert(bb->index - (INVALID_BLOCK+1) < c->length);
+  if (bb->index - (INVALID_BLOCK+1) >= c->length)
+    abort ();
+
   bitmap_set_bit (c->data[bb->index - (INVALID_BLOCK+1)],
 		  edge_index);
 }
@@ -246,7 +240,8 @@ find_control_dependence (el, edge_index, pdom, cdbte)
   basic_block current_block;
   basic_block ending_block;
 
-  assert (INDEX_EDGE_PRED_BB (el, edge_index) != EXIT_BLOCK_PTR);
+  if (INDEX_EDGE_PRED_BB (el, edge_index) == EXIT_BLOCK_PTR)
+    abort ();
   ending_block = 
     (INDEX_EDGE_PRED_BB (el, edge_index) == ENTRY_BLOCK_PTR) 
     ? BASIC_BLOCK (0) 
@@ -271,8 +266,11 @@ find_pdom (pdom, block)
      int *pdom;
      basic_block block;
 {
-  assert (block != NULL);
-  assert (block->index != INVALID_BLOCK);
+  if (!block)
+    abort ();
+  if (block->index == INVALID_BLOCK)
+    abort ();
+
   if (block == ENTRY_BLOCK_PTR)
     return BASIC_BLOCK (0);
   else if (block == EXIT_BLOCK_PTR || pdom[block->index] == EXIT_BLOCK)
@@ -456,9 +454,11 @@ delete_insn_bb (insn)
      rtx insn;
 {
   basic_block bb;
-  assert (insn != NULL_RTX);
+  if (!insn)
+    abort ();
   bb = BLOCK_FOR_INSN (insn);
-  assert (bb != 0);
+  if (!bb)
+    abort ();
   if (bb->head == bb->end)
     {
       /* Delete the insn by converting it to a note.  */
@@ -612,7 +612,8 @@ eliminate_dead_code ()
   /* Release allocated memory.  */
   for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn))
     RESURRECT_INSN (insn);
-  assert (VARRAY_ACTIVE_SIZE(unprocessed_instructions) == 0);
+  if (VARRAY_ACTIVE_SIZE (unprocessed_instructions) != 0)
+    abort ();
   VARRAY_FREE (unprocessed_instructions);
   control_dependent_block_to_edge_map_free (cdbte);
   free ((PTR) pdom);
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 31c66a74d1c0..ed78012127aa 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -58,15 +58,6 @@ Boston, MA 02111-1307, USA.  */
 #include "ggc.h"
 #include "tm_p.h"
 
-/* We cannot use <assert.h> in GCC source, since that would include
-   GCC's assert.h, which may not be compatible with the host compiler.  */
-#undef assert
-#ifdef NDEBUG
-# define assert(e)
-#else
-# define assert(e) do { if (! (e)) abort (); } while (0)
-#endif
-
 /* Decide whether we want to emit frame unwind information for the current
    translation unit.  */
 
@@ -1123,7 +1114,8 @@ dwarf2out_stack_adjust (insn)
 	insn = XVECEXP (insn, 0, 0);
       if (GET_CODE (insn) == SET)
 	insn = SET_SRC (insn);
-      assert (GET_CODE (insn) == CALL);
+      if (GET_CODE (insn) != CALL)
+	abort ();
       dwarf2out_args_size ("", INTVAL (XEXP (insn, 1)));
       return;
     }
diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c
index af1337f4ce83..9e3d5c6639cc 100644
--- a/gcc/dwarfout.c
+++ b/gcc/dwarfout.c
@@ -37,15 +37,6 @@ Boston, MA 02111-1307, USA.  */
 #include "toplev.h"
 #include "tm_p.h"
 
-/* We cannot use <assert.h> in GCC source, since that would include
-   GCC's assert.h, which may not be compatible with the host compiler.  */
-#undef assert
-#ifdef NDEBUG
-# define assert(e)
-#else
-# define assert(e) do { if (! (e)) abort (); } while (0)
-#endif
-
 /* IMPORTANT NOTE: Please see the file README.DWARF for important details
    regarding the GNU implementation of Dwarf.  */
 
diff --git a/gcc/ssa.c b/gcc/ssa.c
index bb4bda71aab2..ec9cc48f3533 100644
--- a/gcc/ssa.c
+++ b/gcc/ssa.c
@@ -48,15 +48,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "output.h"
 #include "ssa.h"
 
-/* We cannot use <assert.h> in GCC source, since that would include
-   GCC's assert.h, which may not be compatible with the host compiler.  */
-#undef assert
-#ifdef NDEBUG
-# define assert(e)
-#else
-# define assert(e) do { if (! (e)) abort (); } while (0)
-#endif
-
 /* TODO: 
 
    Handle subregs better, maybe.  For now, if a reg that's set in a
@@ -1069,7 +1060,8 @@ rename_block (bb, idom)
 	  reg = SET_DEST (phi);
 	  if (REGNO (reg) >= ssa_max_reg_num)
 	    reg = ssa_rename_from_lookup (REGNO (reg));
-	  assert (reg != NULL_RTX);
+	  if (reg == NULL_RTX)
+	    abort ();
 	  reg = ssa_rename_to_lookup (reg);
 
 	  /* It is possible for the variable to be uninitialized on
-- 
GitLab