Commit 3db35af4 by Mark Mitchell Committed by Mark Mitchell

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
parent e457ca6a
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> 2000-08-02 Zack Weinberg <zack@wolery.cumb.org>
* gcc.h (lang_specific_driver): Constify second argument. * gcc.h (lang_specific_driver): Constify second argument.
......
...@@ -77,14 +77,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -77,14 +77,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "recog.h" #include "recog.h"
#include "output.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. */ /* A map from blocks to the edges on which they are control dependent. */
typedef struct { typedef struct {
...@@ -186,7 +178,9 @@ set_control_dependent_block_to_edge_map_bit (c, bb, edge_index) ...@@ -186,7 +178,9 @@ set_control_dependent_block_to_edge_map_bit (c, bb, edge_index)
basic_block bb; basic_block bb;
int edge_index; 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)], bitmap_set_bit (c->data[bb->index - (INVALID_BLOCK+1)],
edge_index); edge_index);
} }
...@@ -246,7 +240,8 @@ find_control_dependence (el, edge_index, pdom, cdbte) ...@@ -246,7 +240,8 @@ find_control_dependence (el, edge_index, pdom, cdbte)
basic_block current_block; basic_block current_block;
basic_block ending_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 = ending_block =
(INDEX_EDGE_PRED_BB (el, edge_index) == ENTRY_BLOCK_PTR) (INDEX_EDGE_PRED_BB (el, edge_index) == ENTRY_BLOCK_PTR)
? BASIC_BLOCK (0) ? BASIC_BLOCK (0)
...@@ -271,8 +266,11 @@ find_pdom (pdom, block) ...@@ -271,8 +266,11 @@ find_pdom (pdom, block)
int *pdom; int *pdom;
basic_block block; basic_block block;
{ {
assert (block != NULL); if (!block)
assert (block->index != INVALID_BLOCK); abort ();
if (block->index == INVALID_BLOCK)
abort ();
if (block == ENTRY_BLOCK_PTR) if (block == ENTRY_BLOCK_PTR)
return BASIC_BLOCK (0); return BASIC_BLOCK (0);
else if (block == EXIT_BLOCK_PTR || pdom[block->index] == EXIT_BLOCK) else if (block == EXIT_BLOCK_PTR || pdom[block->index] == EXIT_BLOCK)
...@@ -456,9 +454,11 @@ delete_insn_bb (insn) ...@@ -456,9 +454,11 @@ delete_insn_bb (insn)
rtx insn; rtx insn;
{ {
basic_block bb; basic_block bb;
assert (insn != NULL_RTX); if (!insn)
abort ();
bb = BLOCK_FOR_INSN (insn); bb = BLOCK_FOR_INSN (insn);
assert (bb != 0); if (!bb)
abort ();
if (bb->head == bb->end) if (bb->head == bb->end)
{ {
/* Delete the insn by converting it to a note. */ /* Delete the insn by converting it to a note. */
...@@ -612,7 +612,8 @@ eliminate_dead_code () ...@@ -612,7 +612,8 @@ eliminate_dead_code ()
/* Release allocated memory. */ /* Release allocated memory. */
for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn)) for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn))
RESURRECT_INSN (insn); RESURRECT_INSN (insn);
assert (VARRAY_ACTIVE_SIZE(unprocessed_instructions) == 0); if (VARRAY_ACTIVE_SIZE (unprocessed_instructions) != 0)
abort ();
VARRAY_FREE (unprocessed_instructions); VARRAY_FREE (unprocessed_instructions);
control_dependent_block_to_edge_map_free (cdbte); control_dependent_block_to_edge_map_free (cdbte);
free ((PTR) pdom); free ((PTR) pdom);
......
...@@ -58,15 +58,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -58,15 +58,6 @@ Boston, MA 02111-1307, USA. */
#include "ggc.h" #include "ggc.h"
#include "tm_p.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 /* Decide whether we want to emit frame unwind information for the current
translation unit. */ translation unit. */
...@@ -1123,7 +1114,8 @@ dwarf2out_stack_adjust (insn) ...@@ -1123,7 +1114,8 @@ dwarf2out_stack_adjust (insn)
insn = XVECEXP (insn, 0, 0); insn = XVECEXP (insn, 0, 0);
if (GET_CODE (insn) == SET) if (GET_CODE (insn) == SET)
insn = SET_SRC (insn); insn = SET_SRC (insn);
assert (GET_CODE (insn) == CALL); if (GET_CODE (insn) != CALL)
abort ();
dwarf2out_args_size ("", INTVAL (XEXP (insn, 1))); dwarf2out_args_size ("", INTVAL (XEXP (insn, 1)));
return; return;
} }
......
...@@ -37,15 +37,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -37,15 +37,6 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h" #include "toplev.h"
#include "tm_p.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 /* IMPORTANT NOTE: Please see the file README.DWARF for important details
regarding the GNU implementation of Dwarf. */ regarding the GNU implementation of Dwarf. */
......
...@@ -48,15 +48,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -48,15 +48,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "output.h" #include "output.h"
#include "ssa.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: /* TODO:
Handle subregs better, maybe. For now, if a reg that's set in a Handle subregs better, maybe. For now, if a reg that's set in a
...@@ -1069,7 +1060,8 @@ rename_block (bb, idom) ...@@ -1069,7 +1060,8 @@ rename_block (bb, idom)
reg = SET_DEST (phi); reg = SET_DEST (phi);
if (REGNO (reg) >= ssa_max_reg_num) if (REGNO (reg) >= ssa_max_reg_num)
reg = ssa_rename_from_lookup (REGNO (reg)); reg = ssa_rename_from_lookup (REGNO (reg));
assert (reg != NULL_RTX); if (reg == NULL_RTX)
abort ();
reg = ssa_rename_to_lookup (reg); reg = ssa_rename_to_lookup (reg);
/* It is possible for the variable to be uninitialized on /* It is possible for the variable to be uninitialized on
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment