aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-08-03 00:17:11 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-08-03 00:17:11 +0000
commit3db35af4a5e89aa783388b58240b7c5b2561a187 (patch)
tree736903c43f30ba905e45449a7537cee8badf4917
parente457ca6a318a8411b2634430cb8ecd209ecf883f (diff)
downloadgcc-3db35af4a5e89aa783388b58240b7c5b2561a187.zip
gcc-3db35af4a5e89aa783388b58240b7c5b2561a187.tar.gz
gcc-3db35af4a5e89aa783388b58240b7c5b2561a187.tar.bz2
dce.c: Remove all uses of assert.
* dce.c: Remove all uses of assert. * dwarf2out.c: Likewise. * dwarfout.c: Likewise. * ssa.c: Likewise. From-SVN: r35438
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/dce.c31
-rw-r--r--gcc/dwarf2out.c12
-rw-r--r--gcc/dwarfout.c9
-rw-r--r--gcc/ssa.c12
5 files changed, 27 insertions, 44 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0c3e56d..9d27b95 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 f385afd..ddd2cd0 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 31c66a7..ed78012 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 af1337f..9e3d5c6 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 bb4bda7..ec9cc48 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