summaryrefslogtreecommitdiff
path: root/gcc/fortran/data.c
diff options
context:
space:
mode:
authorpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-08 14:33:03 +0000
committerpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-08 14:33:03 +0000
commit22d678e818e4cd9b7fe186fa0725a900df3f4db3 (patch)
treea38df818a0e3b820f84fcfd17398ee161742aa6c /gcc/fortran/data.c
parentb98fea5c1220e51f32afa42572c87eefb7f52760 (diff)
downloadgcc-22d678e818e4cd9b7fe186fa0725a900df3f4db3.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87187 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/data.c')
-rw-r--r--gcc/fortran/data.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/gcc/fortran/data.c b/gcc/fortran/data.c
index 2999af2a860..ceb6f318667 100644
--- a/gcc/fortran/data.c
+++ b/gcc/fortran/data.c
@@ -35,7 +35,6 @@ Software Foundation, 59 Temple Place - Suite 330,Boston, MA
#include "config.h"
#include "gfortran.h"
-#include "assert.h"
static void formalize_init_expr (gfc_expr *);
@@ -168,7 +167,7 @@ create_character_intializer (gfc_expr * init, gfc_typespec * ts,
if (ref)
{
- assert (ref->type == REF_SUBSTRING);
+ gcc_assert (ref->type == REF_SUBSTRING);
/* Only set a substring of the destination. Fortran substring bounds
are one-based [start, end], we want zero based [start, end). */
@@ -225,7 +224,7 @@ gfc_assign_data_value (gfc_expr * lvalue, gfc_expr * rvalue, mpz_t index)
if (ref->type == REF_SUBSTRING)
{
/* A substring should always br the last subobject reference. */
- assert (ref->next == NULL);
+ gcc_assert (ref->next == NULL);
break;
}
@@ -250,7 +249,7 @@ gfc_assign_data_value (gfc_expr * lvalue, gfc_expr * rvalue, mpz_t index)
expr->rank = ref->u.ar.as->rank;
}
else
- assert (expr->expr_type == EXPR_ARRAY);
+ gcc_assert (expr->expr_type == EXPR_ARRAY);
if (ref->u.ar.type == AR_ELEMENT)
get_array_index (&ref->u.ar, &offset);
@@ -279,7 +278,7 @@ gfc_assign_data_value (gfc_expr * lvalue, gfc_expr * rvalue, mpz_t index)
expr->ts.derived = ref->u.c.sym;
}
else
- assert (expr->expr_type == EXPR_STRUCTURE);
+ gcc_assert (expr->expr_type == EXPR_STRUCTURE);
last_ts = &ref->u.c.component->ts;
/* Find the same element in the existing constructor. */
@@ -297,7 +296,7 @@ gfc_assign_data_value (gfc_expr * lvalue, gfc_expr * rvalue, mpz_t index)
break;
default:
- abort ();
+ gcc_unreachable ();
}
if (init == NULL)
@@ -317,7 +316,7 @@ gfc_assign_data_value (gfc_expr * lvalue, gfc_expr * rvalue, mpz_t index)
else
{
/* We should never be overwriting an existing initializer. */
- assert (!init);
+ gcc_assert (!init);
expr = gfc_copy_expr (rvalue);
if (!gfc_compare_types (&lvalue->ts, &expr->ts))
@@ -375,7 +374,7 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue,
expr->rank = ref->u.ar.as->rank;
}
else
- assert (expr->expr_type == EXPR_ARRAY);
+ gcc_assert (expr->expr_type == EXPR_ARRAY);
if (ref->u.ar.type == AR_ELEMENT)
{
@@ -383,7 +382,7 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue,
/* This had better not be the bottom of the reference.
We can still get to a full array via a component. */
- assert (ref->next != NULL);
+ gcc_assert (ref->next != NULL);
}
else
{
@@ -392,8 +391,8 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue,
/* We're at a full array or an array section. This means
that we've better have found a full array, and that we're
at the bottom of the reference. */
- assert (ref->u.ar.type == AR_FULL);
- assert (ref->next == NULL);
+ gcc_assert (ref->u.ar.type == AR_FULL);
+ gcc_assert (ref->next == NULL);
}
/* Find the same element in the existing constructor. */
@@ -410,7 +409,7 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue,
gfc_insert_constructor (expr, con);
}
else
- assert (ref->next != NULL);
+ gcc_assert (ref->next != NULL);
break;
case REF_COMPONENT:
@@ -422,7 +421,7 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue,
expr->ts.derived = ref->u.c.sym;
}
else
- assert (expr->expr_type == EXPR_STRUCTURE);
+ gcc_assert (expr->expr_type == EXPR_STRUCTURE);
last_ts = &ref->u.c.component->ts;
/* Find the same element in the existing constructor. */
@@ -440,12 +439,12 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue,
/* Since we're only intending to initialize arrays here,
there better be an inner reference. */
- assert (ref->next != NULL);
+ gcc_assert (ref->next != NULL);
break;
case REF_SUBSTRING:
default:
- abort ();
+ gcc_unreachable ();
}
if (init == NULL)
@@ -461,7 +460,7 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue,
}
/* We should never be overwriting an existing initializer. */
- assert (!init);
+ gcc_assert (!init);
expr = gfc_copy_expr (rvalue);
if (!gfc_compare_types (&lvalue->ts, &expr->ts))
@@ -599,7 +598,7 @@ formalize_structure_cons (gfc_expr * expr)
tail = tail->next;
}
}
- assert (c == NULL);
+ gcc_assert (c == NULL);
expr->value.constructor = head;
}
@@ -683,7 +682,7 @@ gfc_get_section_index (gfc_array_ref *ar, mpz_t *section_index, mpz_t *offset)
gfc_internal_error ("TODO: Vector sections in data statements");
default:
- abort ();
+ gcc_unreachable ();
}
mpz_sub (tmp, ar->as->upper[i]->value.integer,