aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans.c
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2004-09-08 14:33:03 +0000
committerPaul Brook <pbrook@gcc.gnu.org>2004-09-08 14:33:03 +0000
commit6e45f57bf38ac4ca36f085a27729ebc25856333e (patch)
treea38df818a0e3b820f84fcfd17398ee161742aa6c /gcc/fortran/trans.c
parentc3462823c6c68ed4da8ec202ecae00b08708b28d (diff)
downloadgcc-6e45f57bf38ac4ca36f085a27729ebc25856333e.zip
gcc-6e45f57bf38ac4ca36f085a27729ebc25856333e.tar.gz
gcc-6e45f57bf38ac4ca36f085a27729ebc25856333e.tar.bz2
array.c: Don't include assert.h.
* array.c: Don't include assert.h. * data.c: Don't include assert.h. Replace assert and abort with gcc_assert and gcc_unreachable. * dependency.c: Ditto. * f95-lang.c: Ditto. * iresolve.c: Ditto. * resolve.c: Ditto. * simplify.c: Ditto. * symbol.c: Ditto. * trans-array.c: Ditto. * trans-common.c: Ditto. * trans-const.c: Ditto. * trans-decl.c: Ditto. * trans-expr.c: Ditto. * trans-intrinsic.c: Ditto. * trans-io.c: Ditto. * trans-stmt.c: Ditto. * trans-types.c: Ditto. * trans.c: Ditto. From-SVN: r87187
Diffstat (limited to 'gcc/fortran/trans.c')
-rw-r--r--gcc/fortran/trans.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 59decfe..7526c02 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -30,7 +30,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "defaults.h"
#include "real.h"
#include <gmp.h>
-#include <assert.h>
#include "gfortran.h"
#include "trans.h"
#include "trans-stmt.h"
@@ -56,7 +55,7 @@ gfc_advance_chain (tree t, int n)
{
for (; n > 0; n--)
{
- assert (t != NULL_TREE);
+ gcc_assert (t != NULL_TREE);
t = TREE_CHAIN (t);
}
return t;
@@ -151,9 +150,8 @@ gfc_add_modify_expr (stmtblock_t * pblock, tree lhs, tree rhs)
for scalar assignments. We should probably have something
similar for aggregates, but right now removing that check just
breaks everything. */
- if (TREE_TYPE (rhs) != TREE_TYPE (lhs)
- && !AGGREGATE_TYPE_P (TREE_TYPE (lhs)))
- abort ();
+ gcc_assert (TREE_TYPE (rhs) == TREE_TYPE (lhs)
+ || AGGREGATE_TYPE_P (TREE_TYPE (lhs)));
#endif
tmp = fold (build2_v (MODIFY_EXPR, lhs, rhs));
@@ -197,7 +195,7 @@ gfc_merge_block_scope (stmtblock_t * block)
tree decl;
tree next;
- assert (block->has_scope);
+ gcc_assert (block->has_scope);
block->has_scope = 0;
/* Remember the decls in this scope. */
@@ -292,8 +290,7 @@ tree
gfc_build_indirect_ref (tree t)
{
tree type = TREE_TYPE (t);
- if (!POINTER_TYPE_P (type))
- abort ();
+ gcc_assert (POINTER_TYPE_P (type));
type = TREE_TYPE (type);
if (TREE_CODE (t) == ADDR_EXPR)
@@ -309,8 +306,7 @@ tree
gfc_build_array_ref (tree base, tree offset)
{
tree type = TREE_TYPE (base);
- if (TREE_CODE (type) != ARRAY_TYPE)
- abort ();
+ gcc_assert (TREE_CODE (type) == ARRAY_TYPE);
type = TREE_TYPE (type);
if (DECL_P (base))
@@ -356,7 +352,7 @@ gfc_trans_runtime_check (tree cond, tree msg, stmtblock_t * pblock)
/* The code to generate the error. */
gfc_start_block (&block);
- assert (TREE_CODE (msg) == STRING_CST);
+ gcc_assert (TREE_CODE (msg) == STRING_CST);
TREE_USED (msg) = 1;
@@ -396,7 +392,7 @@ gfc_trans_runtime_check (tree cond, tree msg, stmtblock_t * pblock)
void
gfc_add_expr_to_block (stmtblock_t * block, tree expr)
{
- assert (block);
+ gcc_assert (block);
if (expr == NULL_TREE || IS_EMPTY_STMT (expr))
return;
@@ -427,8 +423,8 @@ gfc_add_expr_to_block (stmtblock_t * block, tree expr)
void
gfc_add_block_to_block (stmtblock_t * block, stmtblock_t * append)
{
- assert (append);
- assert (!append->has_scope);
+ gcc_assert (append);
+ gcc_assert (!append->has_scope);
gfc_add_expr_to_block (block, append->head);
append->head = NULL_TREE;