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
This commit is contained in:
Mark Mitchell 2000-08-03 00:17:11 +00:00 committed by Mark Mitchell
parent e457ca6a31
commit 3db35af4a5
5 changed files with 27 additions and 44 deletions

View File

@ -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.

View File

@ -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);

View File

@ -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;
}

View File

@ -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. */

View File

@ -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