Commit 6e45f57b by Paul Brook Committed by Paul Brook

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
parent c3462823
2004-09-08 Paul Brook <paul@codesourcery.com>
* 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.
2004-09-07 Per Bothner <per@bothner.com> 2004-09-07 Per Bothner <per@bothner.com>
Paul Brook <paul@codesourcery.com> Paul Brook <paul@codesourcery.com>
......
...@@ -24,7 +24,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -24,7 +24,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "match.h" #include "match.h"
#include <string.h> #include <string.h>
#include <assert.h>
/* This parameter is the size of the largest array constructor that we /* This parameter is the size of the largest array constructor that we
will expand to an array constructor without iterators. will expand to an array constructor without iterators.
......
...@@ -35,7 +35,6 @@ Software Foundation, 59 Temple Place - Suite 330,Boston, MA ...@@ -35,7 +35,6 @@ Software Foundation, 59 Temple Place - Suite 330,Boston, MA
#include "config.h" #include "config.h"
#include "gfortran.h" #include "gfortran.h"
#include "assert.h"
static void formalize_init_expr (gfc_expr *); static void formalize_init_expr (gfc_expr *);
...@@ -168,7 +167,7 @@ create_character_intializer (gfc_expr * init, gfc_typespec * ts, ...@@ -168,7 +167,7 @@ create_character_intializer (gfc_expr * init, gfc_typespec * ts,
if (ref) if (ref)
{ {
assert (ref->type == REF_SUBSTRING); gcc_assert (ref->type == REF_SUBSTRING);
/* Only set a substring of the destination. Fortran substring bounds /* Only set a substring of the destination. Fortran substring bounds
are one-based [start, end], we want zero based [start, end). */ 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) ...@@ -225,7 +224,7 @@ gfc_assign_data_value (gfc_expr * lvalue, gfc_expr * rvalue, mpz_t index)
if (ref->type == REF_SUBSTRING) if (ref->type == REF_SUBSTRING)
{ {
/* A substring should always br the last subobject reference. */ /* A substring should always br the last subobject reference. */
assert (ref->next == NULL); gcc_assert (ref->next == NULL);
break; break;
} }
...@@ -250,7 +249,7 @@ gfc_assign_data_value (gfc_expr * lvalue, gfc_expr * rvalue, mpz_t index) ...@@ -250,7 +249,7 @@ gfc_assign_data_value (gfc_expr * lvalue, gfc_expr * rvalue, mpz_t index)
expr->rank = ref->u.ar.as->rank; expr->rank = ref->u.ar.as->rank;
} }
else else
assert (expr->expr_type == EXPR_ARRAY); gcc_assert (expr->expr_type == EXPR_ARRAY);
if (ref->u.ar.type == AR_ELEMENT) if (ref->u.ar.type == AR_ELEMENT)
get_array_index (&ref->u.ar, &offset); get_array_index (&ref->u.ar, &offset);
...@@ -279,7 +278,7 @@ gfc_assign_data_value (gfc_expr * lvalue, gfc_expr * rvalue, mpz_t index) ...@@ -279,7 +278,7 @@ gfc_assign_data_value (gfc_expr * lvalue, gfc_expr * rvalue, mpz_t index)
expr->ts.derived = ref->u.c.sym; expr->ts.derived = ref->u.c.sym;
} }
else else
assert (expr->expr_type == EXPR_STRUCTURE); gcc_assert (expr->expr_type == EXPR_STRUCTURE);
last_ts = &ref->u.c.component->ts; last_ts = &ref->u.c.component->ts;
/* Find the same element in the existing constructor. */ /* 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) ...@@ -297,7 +296,7 @@ gfc_assign_data_value (gfc_expr * lvalue, gfc_expr * rvalue, mpz_t index)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
if (init == NULL) if (init == NULL)
...@@ -317,7 +316,7 @@ gfc_assign_data_value (gfc_expr * lvalue, gfc_expr * rvalue, mpz_t index) ...@@ -317,7 +316,7 @@ gfc_assign_data_value (gfc_expr * lvalue, gfc_expr * rvalue, mpz_t index)
else else
{ {
/* We should never be overwriting an existing initializer. */ /* We should never be overwriting an existing initializer. */
assert (!init); gcc_assert (!init);
expr = gfc_copy_expr (rvalue); expr = gfc_copy_expr (rvalue);
if (!gfc_compare_types (&lvalue->ts, &expr->ts)) if (!gfc_compare_types (&lvalue->ts, &expr->ts))
...@@ -375,7 +374,7 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue, ...@@ -375,7 +374,7 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue,
expr->rank = ref->u.ar.as->rank; expr->rank = ref->u.ar.as->rank;
} }
else else
assert (expr->expr_type == EXPR_ARRAY); gcc_assert (expr->expr_type == EXPR_ARRAY);
if (ref->u.ar.type == AR_ELEMENT) if (ref->u.ar.type == AR_ELEMENT)
{ {
...@@ -383,7 +382,7 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue, ...@@ -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. /* This had better not be the bottom of the reference.
We can still get to a full array via a component. */ We can still get to a full array via a component. */
assert (ref->next != NULL); gcc_assert (ref->next != NULL);
} }
else else
{ {
...@@ -392,8 +391,8 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue, ...@@ -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 /* 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 that we've better have found a full array, and that we're
at the bottom of the reference. */ at the bottom of the reference. */
assert (ref->u.ar.type == AR_FULL); gcc_assert (ref->u.ar.type == AR_FULL);
assert (ref->next == NULL); gcc_assert (ref->next == NULL);
} }
/* Find the same element in the existing constructor. */ /* Find the same element in the existing constructor. */
...@@ -410,7 +409,7 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue, ...@@ -410,7 +409,7 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue,
gfc_insert_constructor (expr, con); gfc_insert_constructor (expr, con);
} }
else else
assert (ref->next != NULL); gcc_assert (ref->next != NULL);
break; break;
case REF_COMPONENT: case REF_COMPONENT:
...@@ -422,7 +421,7 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue, ...@@ -422,7 +421,7 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue,
expr->ts.derived = ref->u.c.sym; expr->ts.derived = ref->u.c.sym;
} }
else else
assert (expr->expr_type == EXPR_STRUCTURE); gcc_assert (expr->expr_type == EXPR_STRUCTURE);
last_ts = &ref->u.c.component->ts; last_ts = &ref->u.c.component->ts;
/* Find the same element in the existing constructor. */ /* Find the same element in the existing constructor. */
...@@ -440,12 +439,12 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue, ...@@ -440,12 +439,12 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue,
/* Since we're only intending to initialize arrays here, /* Since we're only intending to initialize arrays here,
there better be an inner reference. */ there better be an inner reference. */
assert (ref->next != NULL); gcc_assert (ref->next != NULL);
break; break;
case REF_SUBSTRING: case REF_SUBSTRING:
default: default:
abort (); gcc_unreachable ();
} }
if (init == NULL) if (init == NULL)
...@@ -461,7 +460,7 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue, ...@@ -461,7 +460,7 @@ gfc_assign_data_value_range (gfc_expr * lvalue, gfc_expr * rvalue,
} }
/* We should never be overwriting an existing initializer. */ /* We should never be overwriting an existing initializer. */
assert (!init); gcc_assert (!init);
expr = gfc_copy_expr (rvalue); expr = gfc_copy_expr (rvalue);
if (!gfc_compare_types (&lvalue->ts, &expr->ts)) if (!gfc_compare_types (&lvalue->ts, &expr->ts))
...@@ -599,7 +598,7 @@ formalize_structure_cons (gfc_expr * expr) ...@@ -599,7 +598,7 @@ formalize_structure_cons (gfc_expr * expr)
tail = tail->next; tail = tail->next;
} }
} }
assert (c == NULL); gcc_assert (c == NULL);
expr->value.constructor = head; expr->value.constructor = head;
} }
...@@ -683,7 +682,7 @@ gfc_get_section_index (gfc_array_ref *ar, mpz_t *section_index, mpz_t *offset) ...@@ -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"); gfc_internal_error ("TODO: Vector sections in data statements");
default: default:
abort (); gcc_unreachable ();
} }
mpz_sub (tmp, ar->as->upper[i]->value.integer, mpz_sub (tmp, ar->as->upper[i]->value.integer,
......
...@@ -28,7 +28,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -28,7 +28,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h" #include "config.h"
#include "gfortran.h" #include "gfortran.h"
#include "dependency.h" #include "dependency.h"
#include <assert.h>
/* static declarations */ /* static declarations */
/* Enums */ /* Enums */
...@@ -55,7 +54,7 @@ gfc_dependency; ...@@ -55,7 +54,7 @@ gfc_dependency;
int int
gfc_expr_is_one (gfc_expr * expr, int def) gfc_expr_is_one (gfc_expr * expr, int def)
{ {
assert (expr != NULL); gcc_assert (expr != NULL);
if (expr->expr_type != EXPR_CONSTANT) if (expr->expr_type != EXPR_CONSTANT)
return def; return def;
...@@ -115,9 +114,9 @@ gfc_is_same_range (gfc_array_ref * ar1, gfc_array_ref * ar2, int n, int def) ...@@ -115,9 +114,9 @@ gfc_is_same_range (gfc_array_ref * ar1, gfc_array_ref * ar2, int n, int def)
int i; int i;
/* TODO: More sophisticated range comparison. */ /* TODO: More sophisticated range comparison. */
assert (ar1 && ar2); gcc_assert (ar1 && ar2);
assert (ar1->dimen_type[n] == ar2->dimen_type[n]); gcc_assert (ar1->dimen_type[n] == ar2->dimen_type[n]);
e1 = ar1->stride[n]; e1 = ar1->stride[n];
e2 = ar2->stride[n]; e2 = ar2->stride[n];
...@@ -190,9 +189,9 @@ gfc_check_fncall_dependency (gfc_expr * dest, gfc_expr * fncall) ...@@ -190,9 +189,9 @@ gfc_check_fncall_dependency (gfc_expr * dest, gfc_expr * fncall)
gfc_expr *expr; gfc_expr *expr;
int n; int n;
assert (dest->expr_type == EXPR_VARIABLE gcc_assert (dest->expr_type == EXPR_VARIABLE
&& fncall->expr_type == EXPR_FUNCTION); && fncall->expr_type == EXPR_FUNCTION);
assert (fncall->rank > 0); gcc_assert (fncall->rank > 0);
for (actual = fncall->value.function.actual; actual; actual = actual->next) for (actual = fncall->value.function.actual; actual; actual = actual->next)
{ {
...@@ -214,7 +213,7 @@ gfc_check_fncall_dependency (gfc_expr * dest, gfc_expr * fncall) ...@@ -214,7 +213,7 @@ gfc_check_fncall_dependency (gfc_expr * dest, gfc_expr * fncall)
if (ref->type == REF_ARRAY && ref->u.ar.type != AR_ELEMENT) if (ref->type == REF_ARRAY && ref->u.ar.type != AR_ELEMENT)
break; break;
} }
assert (ref); gcc_assert (ref);
/* AR_FULL can't contain vector subscripts. */ /* AR_FULL can't contain vector subscripts. */
if (ref->u.ar.type == AR_SECTION) if (ref->u.ar.type == AR_SECTION)
{ {
...@@ -264,7 +263,7 @@ gfc_check_dependency (gfc_expr * expr1, gfc_expr * expr2, gfc_expr ** vars, ...@@ -264,7 +263,7 @@ gfc_check_dependency (gfc_expr * expr1, gfc_expr * expr2, gfc_expr ** vars,
int n; int n;
gfc_actual_arglist *actual; gfc_actual_arglist *actual;
assert (expr1->expr_type == EXPR_VARIABLE); gcc_assert (expr1->expr_type == EXPR_VARIABLE);
/* TODO: -fassume-no-pointer-aliasing */ /* TODO: -fassume-no-pointer-aliasing */
if (expr1->symtree->n.sym->attr.pointer) if (expr1->symtree->n.sym->attr.pointer)
...@@ -604,7 +603,7 @@ gfc_dep_resolver (gfc_ref * lref, gfc_ref * rref) ...@@ -604,7 +603,7 @@ gfc_dep_resolver (gfc_ref * lref, gfc_ref * rref)
/* We're resolving from the same base symbol, so both refs should be /* We're resolving from the same base symbol, so both refs should be
the same type. We traverse the reference chain intil we find ranges the same type. We traverse the reference chain intil we find ranges
that are not equal. */ that are not equal. */
assert (lref->type == rref->type); gcc_assert (lref->type == rref->type);
switch (lref->type) switch (lref->type)
{ {
case REF_COMPONENT: case REF_COMPONENT:
...@@ -638,7 +637,7 @@ gfc_dep_resolver (gfc_ref * lref, gfc_ref * rref) ...@@ -638,7 +637,7 @@ gfc_dep_resolver (gfc_ref * lref, gfc_ref * rref)
this_dep = gfc_check_element_vs_section (rref, lref, n); this_dep = gfc_check_element_vs_section (rref, lref, n);
else else
{ {
assert (rref->u.ar.dimen_type[n] == DIMEN_ELEMENT gcc_assert (rref->u.ar.dimen_type[n] == DIMEN_ELEMENT
&& lref->u.ar.dimen_type[n] == DIMEN_ELEMENT); && lref->u.ar.dimen_type[n] == DIMEN_ELEMENT);
this_dep = gfc_check_element_vs_element (rref, lref, n); this_dep = gfc_check_element_vs_element (rref, lref, n);
} }
...@@ -662,14 +661,14 @@ gfc_dep_resolver (gfc_ref * lref, gfc_ref * rref) ...@@ -662,14 +661,14 @@ gfc_dep_resolver (gfc_ref * lref, gfc_ref * rref)
break; break;
default: default:
abort(); gcc_unreachable ();
} }
lref = lref->next; lref = lref->next;
rref = rref->next; rref = rref->next;
} }
/* If we haven't seen any array refs then something went wrong. */ /* If we haven't seen any array refs then something went wrong. */
assert (fin_dep != GFC_DEP_ERROR); gcc_assert (fin_dep != GFC_DEP_ERROR);
if (fin_dep < GFC_DEP_OVERLAP) if (fin_dep < GFC_DEP_OVERLAP)
return 0; return 0;
......
...@@ -49,7 +49,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -49,7 +49,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "trans-types.h" #include "trans-types.h"
#include "trans-const.h" #include "trans-const.h"
#include <assert.h>
#include <stdio.h> #include <stdio.h>
/* Language-dependent contents of an identifier. */ /* Language-dependent contents of an identifier. */
......
...@@ -31,7 +31,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -31,7 +31,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h" #include "config.h"
#include <string.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
#include <assert.h>
#include "gfortran.h" #include "gfortran.h"
#include "intrinsic.h" #include "intrinsic.h"
......
...@@ -22,7 +22,6 @@ Software Foundation, 59 Temple Place - Suite 330,Boston, MA ...@@ -22,7 +22,6 @@ Software Foundation, 59 Temple Place - Suite 330,Boston, MA
#include "config.h" #include "config.h"
#include "gfortran.h" #include "gfortran.h"
#include "arith.h" /* For gfc_compare_expr(). */ #include "arith.h" /* For gfc_compare_expr(). */
#include <assert.h>
#include <string.h> #include <string.h>
/* Stack to push the current if we descend into a block during /* Stack to push the current if we descend into a block during
...@@ -345,7 +344,7 @@ resolve_entries (gfc_namespace * ns) ...@@ -345,7 +344,7 @@ resolve_entries (gfc_namespace * ns)
return; return;
/* If this isn't a procedure something has gone horribly wrong. */ /* If this isn't a procedure something has gone horribly wrong. */
assert (ns->proc_name->attr.flavor == FL_PROCEDURE); gcc_assert (ns->proc_name->attr.flavor == FL_PROCEDURE);
/* Remember the current namespace. */ /* Remember the current namespace. */
old_ns = gfc_current_ns; old_ns = gfc_current_ns;
...@@ -375,7 +374,7 @@ resolve_entries (gfc_namespace * ns) ...@@ -375,7 +374,7 @@ resolve_entries (gfc_namespace * ns)
master_count++, ns->proc_name->name); master_count++, ns->proc_name->name);
name[GFC_MAX_SYMBOL_LEN] = '\0'; name[GFC_MAX_SYMBOL_LEN] = '\0';
gfc_get_ha_symbol (name, &proc); gfc_get_ha_symbol (name, &proc);
assert (proc != NULL); gcc_assert (proc != NULL);
gfc_add_procedure (&proc->attr, PROC_INTERNAL, NULL); gfc_add_procedure (&proc->attr, PROC_INTERNAL, NULL);
if (ns->proc_name->attr.subroutine) if (ns->proc_name->attr.subroutine)
...@@ -3224,7 +3223,7 @@ gfc_find_forall_index (gfc_expr *expr, gfc_symbol *symbol) ...@@ -3224,7 +3223,7 @@ gfc_find_forall_index (gfc_expr *expr, gfc_symbol *symbol)
switch (expr->expr_type) switch (expr->expr_type)
{ {
case EXPR_VARIABLE: case EXPR_VARIABLE:
assert (expr->symtree->n.sym); gcc_assert (expr->symtree->n.sym);
/* A scalar assignment */ /* A scalar assignment */
if (!expr->ref) if (!expr->ref)
...@@ -3296,7 +3295,7 @@ gfc_find_forall_index (gfc_expr *expr, gfc_symbol *symbol) ...@@ -3296,7 +3295,7 @@ gfc_find_forall_index (gfc_expr *expr, gfc_symbol *symbol)
if (expr->ref) if (expr->ref)
{ {
tmp = expr->ref; tmp = expr->ref;
assert(expr->ref->type == REF_SUBSTRING); gcc_assert (expr->ref->type == REF_SUBSTRING);
if (gfc_find_forall_index (tmp->u.ss.start, symbol) == SUCCESS) if (gfc_find_forall_index (tmp->u.ss.start, symbol) == SUCCESS)
return SUCCESS; return SUCCESS;
if (gfc_find_forall_index (tmp->u.ss.end, symbol) == SUCCESS) if (gfc_find_forall_index (tmp->u.ss.end, symbol) == SUCCESS)
...@@ -3791,7 +3790,7 @@ resolve_code (gfc_code * code, gfc_namespace * ns) ...@@ -3791,7 +3790,7 @@ resolve_code (gfc_code * code, gfc_namespace * ns)
break; break;
case EXEC_IOLENGTH: case EXEC_IOLENGTH:
assert(code->ext.inquire != NULL); gcc_assert (code->ext.inquire != NULL);
if (gfc_resolve_inquire (code->ext.inquire) == FAILURE) if (gfc_resolve_inquire (code->ext.inquire) == FAILURE)
break; break;
...@@ -4159,7 +4158,7 @@ check_data_variable (gfc_data_variable * var, locus * where) ...@@ -4159,7 +4158,7 @@ check_data_variable (gfc_data_variable * var, locus * where)
continue; continue;
break; break;
} }
assert (ref); gcc_assert (ref);
/* Set marks asscording to the reference pattern. */ /* Set marks asscording to the reference pattern. */
switch (ref->u.ar.type) switch (ref->u.ar.type)
...@@ -4176,7 +4175,7 @@ check_data_variable (gfc_data_variable * var, locus * where) ...@@ -4176,7 +4175,7 @@ check_data_variable (gfc_data_variable * var, locus * where)
break; break;
default: default:
abort(); gcc_unreachable ();
} }
if (gfc_array_size (e, &size) == FAILURE) if (gfc_array_size (e, &size) == FAILURE)
......
...@@ -828,7 +828,7 @@ gfc_simplify_digits (gfc_expr * x) ...@@ -828,7 +828,7 @@ gfc_simplify_digits (gfc_expr * x)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
return gfc_int_expr (digits); return gfc_int_expr (digits);
...@@ -1115,7 +1115,7 @@ gfc_simplify_huge (gfc_expr * e) ...@@ -1115,7 +1115,7 @@ gfc_simplify_huge (gfc_expr * e)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
return result; return result;
...@@ -2477,7 +2477,7 @@ gfc_simplify_radix (gfc_expr * e) ...@@ -2477,7 +2477,7 @@ gfc_simplify_radix (gfc_expr * e)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
result = gfc_int_expr (i); result = gfc_int_expr (i);
...@@ -2508,7 +2508,7 @@ gfc_simplify_range (gfc_expr * e) ...@@ -2508,7 +2508,7 @@ gfc_simplify_range (gfc_expr * e)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
result = gfc_int_expr (j); result = gfc_int_expr (j);
......
...@@ -25,7 +25,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -25,7 +25,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <assert.h>
#include "gfortran.h" #include "gfortran.h"
#include "parse.h" #include "parse.h"
...@@ -2206,7 +2205,7 @@ gfc_free_namespace (gfc_namespace * ns) ...@@ -2206,7 +2205,7 @@ gfc_free_namespace (gfc_namespace * ns)
ns->refs--; ns->refs--;
if (ns->refs > 0) if (ns->refs > 0)
return; return;
assert (ns->refs == 0); gcc_assert (ns->refs == 0);
gfc_free_statements (ns->code); gfc_free_statements (ns->code);
......
...@@ -103,7 +103,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -103,7 +103,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "trans.h" #include "trans.h"
#include "trans-types.h" #include "trans-types.h"
#include "trans-const.h" #include "trans-const.h"
#include <assert.h>
/* Holds a single variable in a equivalence set. */ /* Holds a single variable in a equivalence set. */
...@@ -414,7 +413,7 @@ create_common (gfc_common_head *com) ...@@ -414,7 +413,7 @@ create_common (gfc_common_head *com)
offset = s->offset + s->length; offset = s->offset + s->length;
} }
} }
assert (list); gcc_assert (list);
ctor = build1 (CONSTRUCTOR, union_type, nreverse(list)); ctor = build1 (CONSTRUCTOR, union_type, nreverse(list));
TREE_CONSTANT (ctor) = 1; TREE_CONSTANT (ctor) = 1;
TREE_INVARIANT (ctor) = 1; TREE_INVARIANT (ctor) = 1;
...@@ -423,7 +422,7 @@ create_common (gfc_common_head *com) ...@@ -423,7 +422,7 @@ create_common (gfc_common_head *com)
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
for (tmp = CONSTRUCTOR_ELTS (ctor); tmp; tmp = TREE_CHAIN (tmp)) for (tmp = CONSTRUCTOR_ELTS (ctor); tmp; tmp = TREE_CHAIN (tmp))
assert (TREE_CODE (TREE_PURPOSE (tmp)) == FIELD_DECL); gcc_assert (TREE_CODE (TREE_PURPOSE (tmp)) == FIELD_DECL);
#endif #endif
} }
......
...@@ -30,7 +30,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -30,7 +30,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "toplev.h" #include "toplev.h"
#include "real.h" #include "real.h"
#include <gmp.h> #include <gmp.h>
#include <assert.h>
#include <math.h> #include <math.h>
#include "gfortran.h" #include "gfortran.h"
#include "trans.h" #include "trans.h"
...@@ -70,7 +69,7 @@ gfc_build_const (tree type, tree intval) ...@@ -70,7 +69,7 @@ gfc_build_const (tree type, tree intval)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
return val; return val;
} }
...@@ -102,10 +101,10 @@ gfc_conv_string_init (tree length, gfc_expr * expr) ...@@ -102,10 +101,10 @@ gfc_conv_string_init (tree length, gfc_expr * expr)
int slen; int slen;
tree str; tree str;
assert (expr->expr_type == EXPR_CONSTANT); gcc_assert (expr->expr_type == EXPR_CONSTANT);
assert (expr->ts.type == BT_CHARACTER && expr->ts.kind == 1); gcc_assert (expr->ts.type == BT_CHARACTER && expr->ts.kind == 1);
assert (INTEGER_CST_P (length)); gcc_assert (INTEGER_CST_P (length));
assert (TREE_INT_CST_HIGH (length) == 0); gcc_assert (TREE_INT_CST_HIGH (length) == 0);
len = TREE_INT_CST_LOW (length); len = TREE_INT_CST_LOW (length);
slen = expr->value.character.length; slen = expr->value.character.length;
...@@ -191,7 +190,7 @@ gfc_conv_mpz_to_tree (mpz_t i, int kind) ...@@ -191,7 +190,7 @@ gfc_conv_mpz_to_tree (mpz_t i, int kind)
/* We assume that all numbers are in range for its type, and that /* We assume that all numbers are in range for its type, and that
we never create a type larger than 2*HWI, which is the largest we never create a type larger than 2*HWI, which is the largest
that the middle-end can handle. */ that the middle-end can handle. */
assert (count == 1 || count == 2); gcc_assert (count == 1 || count == 2);
low = words[0]; low = words[0];
high = words[1]; high = words[1];
...@@ -228,7 +227,7 @@ gfc_conv_mpfr_to_tree (mpfr_t f, int kind) ...@@ -228,7 +227,7 @@ gfc_conv_mpfr_to_tree (mpfr_t f, int kind)
if (gfc_real_kinds[n].kind == kind) if (gfc_real_kinds[n].kind == kind)
break; break;
} }
assert (gfc_real_kinds[n].kind); gcc_assert (gfc_real_kinds[n].kind);
n = MAX (abs (gfc_real_kinds[n].min_exponent), n = MAX (abs (gfc_real_kinds[n].min_exponent),
abs (gfc_real_kinds[n].max_exponent)); abs (gfc_real_kinds[n].max_exponent));
...@@ -292,7 +291,7 @@ gfc_conv_mpfr_to_tree (mpfr_t f, int kind) ...@@ -292,7 +291,7 @@ gfc_conv_mpfr_to_tree (mpfr_t f, int kind)
tree tree
gfc_conv_constant_to_tree (gfc_expr * expr) gfc_conv_constant_to_tree (gfc_expr * expr)
{ {
assert (expr->expr_type == EXPR_CONSTANT); gcc_assert (expr->expr_type == EXPR_CONSTANT);
switch (expr->ts.type) switch (expr->ts.type)
{ {
...@@ -332,13 +331,13 @@ gfc_conv_constant_to_tree (gfc_expr * expr) ...@@ -332,13 +331,13 @@ gfc_conv_constant_to_tree (gfc_expr * expr)
void void
gfc_conv_constant (gfc_se * se, gfc_expr * expr) gfc_conv_constant (gfc_se * se, gfc_expr * expr)
{ {
assert (expr->expr_type == EXPR_CONSTANT); gcc_assert (expr->expr_type == EXPR_CONSTANT);
if (se->ss != NULL) if (se->ss != NULL)
{ {
assert (se->ss != gfc_ss_terminator); gcc_assert (se->ss != gfc_ss_terminator);
assert (se->ss->type == GFC_SS_SCALAR); gcc_assert (se->ss->type == GFC_SS_SCALAR);
assert (se->ss->expr == expr); gcc_assert (se->ss->expr == expr);
se->expr = se->ss->data.scalar.expr; se->expr = se->ss->data.scalar.expr;
se->string_length = se->ss->string_length; se->string_length = se->ss->string_length;
......
...@@ -29,7 +29,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -29,7 +29,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ggc.h" #include "ggc.h"
#include "toplev.h" #include "toplev.h"
#include "real.h" #include "real.h"
#include <assert.h>
#include <gmp.h> #include <gmp.h>
#include "gfortran.h" #include "gfortran.h"
#include "trans.h" #include "trans.h"
...@@ -867,7 +866,7 @@ transfer_namelist_element (stmtblock_t * block, gfc_typespec * ts, tree addr_exp ...@@ -867,7 +866,7 @@ transfer_namelist_element (stmtblock_t * block, gfc_typespec * ts, tree addr_exp
tree tmp, args, arg2; tree tmp, args, arg2;
tree expr; tree expr;
assert (POINTER_TYPE_P (TREE_TYPE (addr_expr))); gcc_assert (POINTER_TYPE_P (TREE_TYPE (addr_expr)));
if (ts->type == BT_DERIVED) if (ts->type == BT_DERIVED)
{ {
...@@ -877,7 +876,7 @@ transfer_namelist_element (stmtblock_t * block, gfc_typespec * ts, tree addr_exp ...@@ -877,7 +876,7 @@ transfer_namelist_element (stmtblock_t * block, gfc_typespec * ts, tree addr_exp
for (c = ts->derived->components; c; c = c->next) for (c = ts->derived->components; c; c = c->next)
{ {
tree field = c->backend_decl; tree field = c->backend_decl;
assert (field && TREE_CODE (field) == FIELD_DECL); gcc_assert (field && TREE_CODE (field) == FIELD_DECL);
tmp = build3 (COMPONENT_REF, TREE_TYPE (field), tmp = build3 (COMPONENT_REF, TREE_TYPE (field),
expr, field, NULL_TREE); expr, field, NULL_TREE);
...@@ -913,7 +912,7 @@ transfer_namelist_element (stmtblock_t * block, gfc_typespec * ts, tree addr_exp ...@@ -913,7 +912,7 @@ transfer_namelist_element (stmtblock_t * block, gfc_typespec * ts, tree addr_exp
case BT_CHARACTER: case BT_CHARACTER:
expr = gfc_build_indirect_ref (addr_expr); expr = gfc_build_indirect_ref (addr_expr);
assert (TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE); gcc_assert (TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE);
args = gfc_chainon_list (args, args = gfc_chainon_list (args,
TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (expr)))); TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (expr))));
tmp = gfc_build_function_call (iocall_set_nml_val_char, args); tmp = gfc_build_function_call (iocall_set_nml_val_char, args);
...@@ -958,7 +957,7 @@ build_dt (tree * function, gfc_code * code) ...@@ -958,7 +957,7 @@ build_dt (tree * function, gfc_code * code)
set_error_locus (&block, &code->loc); set_error_locus (&block, &code->loc);
dt = code->ext.dt; dt = code->ext.dt;
assert (dt != NULL); gcc_assert (dt != NULL);
if (dt->io_unit) if (dt->io_unit)
{ {
...@@ -1061,8 +1060,8 @@ gfc_trans_iolength (gfc_code * code) ...@@ -1061,8 +1060,8 @@ gfc_trans_iolength (gfc_code * code)
inq = code->ext.inquire; inq = code->ext.inquire;
/* First check that preconditions are met. */ /* First check that preconditions are met. */
assert(inq != NULL); gcc_assert (inq != NULL);
assert(inq->iolength != NULL); gcc_assert (inq->iolength != NULL);
/* Connect to the iolength variable. */ /* Connect to the iolength variable. */
if (inq->iolength) if (inq->iolength)
...@@ -1125,7 +1124,7 @@ gfc_trans_dt_end (gfc_code * code) ...@@ -1125,7 +1124,7 @@ gfc_trans_dt_end (gfc_code * code)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
tmp = gfc_build_function_call (function, NULL); tmp = gfc_build_function_call (function, NULL);
...@@ -1133,7 +1132,7 @@ gfc_trans_dt_end (gfc_code * code) ...@@ -1133,7 +1132,7 @@ gfc_trans_dt_end (gfc_code * code)
if (last_dt != IOLENGTH) if (last_dt != IOLENGTH)
{ {
assert(code->ext.dt != NULL); gcc_assert (code->ext.dt != NULL);
io_result (&block, code->ext.dt->err, io_result (&block, code->ext.dt->err,
code->ext.dt->end, code->ext.dt->eor); code->ext.dt->end, code->ext.dt->eor);
} }
...@@ -1189,14 +1188,14 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr) ...@@ -1189,14 +1188,14 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr)
for (c = ts->derived->components; c; c = c->next) for (c = ts->derived->components; c; c = c->next)
{ {
field = c->backend_decl; field = c->backend_decl;
assert (field && TREE_CODE (field) == FIELD_DECL); gcc_assert (field && TREE_CODE (field) == FIELD_DECL);
tmp = build3 (COMPONENT_REF, TREE_TYPE (field), expr, field, tmp = build3 (COMPONENT_REF, TREE_TYPE (field), expr, field,
NULL_TREE); NULL_TREE);
if (c->ts.type == BT_CHARACTER) if (c->ts.type == BT_CHARACTER)
{ {
assert (TREE_CODE (TREE_TYPE (tmp)) == ARRAY_TYPE); gcc_assert (TREE_CODE (TREE_TYPE (tmp)) == ARRAY_TYPE);
se->string_length = se->string_length =
TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (tmp))); TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (tmp)));
} }
...@@ -1272,7 +1271,7 @@ gfc_trans_transfer (gfc_code * code) ...@@ -1272,7 +1271,7 @@ gfc_trans_transfer (gfc_code * code)
tmp = gfc_finish_block (&body); tmp = gfc_finish_block (&body);
else else
{ {
assert (se.ss == gfc_ss_terminator); gcc_assert (se.ss == gfc_ss_terminator);
gfc_trans_scalarizing_loops (&loop, &body); gfc_trans_scalarizing_loops (&loop, &body);
gfc_add_block_to_block (&loop.pre, &loop.post); gfc_add_block_to_block (&loop.pre, &loop.post);
......
...@@ -30,7 +30,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -30,7 +30,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ggc.h" #include "ggc.h"
#include "toplev.h" #include "toplev.h"
#include "real.h" #include "real.h"
#include <assert.h>
#include <gmp.h> #include <gmp.h>
#include "gfortran.h" #include "gfortran.h"
#include "trans.h" #include "trans.h"
...@@ -199,7 +198,7 @@ gfc_trans_call (gfc_code * code) ...@@ -199,7 +198,7 @@ gfc_trans_call (gfc_code * code)
gfc_init_se (&se, NULL); gfc_init_se (&se, NULL);
gfc_start_block (&se.pre); gfc_start_block (&se.pre);
assert (code->resolved_sym); gcc_assert (code->resolved_sym);
has_alternate_specifier = 0; has_alternate_specifier = 0;
/* Translate the call. */ /* Translate the call. */
...@@ -214,7 +213,7 @@ gfc_trans_call (gfc_code * code) ...@@ -214,7 +213,7 @@ gfc_trans_call (gfc_code * code)
gfc_code *select_code; gfc_code *select_code;
gfc_symbol *sym; gfc_symbol *sym;
select_code = code->next; select_code = code->next;
assert(select_code->op == EXEC_SELECT); gcc_assert(select_code->op == EXEC_SELECT);
sym = select_code->expr->symtree->n.sym; sym = select_code->expr->symtree->n.sym;
se.expr = convert (gfc_typenode_for_spec (&sym->ts), se.expr); se.expr = convert (gfc_typenode_for_spec (&sym->ts), se.expr);
gfc_add_modify_expr (&se.pre, sym->backend_decl, se.expr); gfc_add_modify_expr (&se.pre, sym->backend_decl, se.expr);
...@@ -1169,7 +1168,7 @@ gfc_trans_character_select (gfc_code *code) ...@@ -1169,7 +1168,7 @@ gfc_trans_character_select (gfc_code *code)
tree tree
gfc_trans_select (gfc_code * code) gfc_trans_select (gfc_code * code)
{ {
assert (code && code->expr); gcc_assert (code && code->expr);
/* Empty SELECT constructs are legal. */ /* Empty SELECT constructs are legal. */
if (code->block == NULL) if (code->block == NULL)
...@@ -1367,7 +1366,7 @@ gfc_do_allocate (tree bytesize, tree size, tree * pdata, stmtblock_t * pblock, ...@@ -1367,7 +1366,7 @@ gfc_do_allocate (tree bytesize, tree size, tree * pdata, stmtblock_t * pblock,
type = build_array_type (elem_type, type); type = build_array_type (elem_type, type);
if (gfc_can_put_var_on_stack (bytesize)) if (gfc_can_put_var_on_stack (bytesize))
{ {
assert (INTEGER_CST_P (size)); gcc_assert (INTEGER_CST_P (size));
tmpvar = gfc_create_var (type, "temp"); tmpvar = gfc_create_var (type, "temp");
*pdata = NULL_TREE; *pdata = NULL_TREE;
} }
...@@ -1382,7 +1381,7 @@ gfc_do_allocate (tree bytesize, tree size, tree * pdata, stmtblock_t * pblock, ...@@ -1382,7 +1381,7 @@ gfc_do_allocate (tree bytesize, tree size, tree * pdata, stmtblock_t * pblock,
else if (gfc_index_integer_kind == 8) else if (gfc_index_integer_kind == 8)
tmp = gfor_fndecl_internal_malloc64; tmp = gfor_fndecl_internal_malloc64;
else else
abort (); gcc_unreachable ();
tmp = gfc_build_function_call (tmp, args); tmp = gfc_build_function_call (tmp, args);
tmp = convert (TREE_TYPE (tmpvar), tmp); tmp = convert (TREE_TYPE (tmpvar), tmp);
gfc_add_modify_expr (pblock, tmpvar, tmp); gfc_add_modify_expr (pblock, tmpvar, tmp);
...@@ -2389,8 +2388,7 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info) ...@@ -2389,8 +2388,7 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info)
break; break;
default: default:
abort (); gcc_unreachable ();
break;
} }
c = c->next; c = c->next;
...@@ -2614,7 +2612,7 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, tree mask, ...@@ -2614,7 +2612,7 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, tree mask,
/* In each where-assign-stmt, the mask-expr and the variable being /* In each where-assign-stmt, the mask-expr and the variable being
defined shall be arrays of the same shape. */ defined shall be arrays of the same shape. */
assert (lss != gfc_ss_terminator); gcc_assert (lss != gfc_ss_terminator);
/* The assignment needs scalarization. */ /* The assignment needs scalarization. */
lss_section = lss; lss_section = lss;
...@@ -2624,7 +2622,7 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, tree mask, ...@@ -2624,7 +2622,7 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, tree mask,
&& lss_section->type != GFC_SS_SECTION) && lss_section->type != GFC_SS_SECTION)
lss_section = lss_section->next; lss_section = lss_section->next;
assert (lss_section != gfc_ss_terminator); gcc_assert (lss_section != gfc_ss_terminator);
/* Initialize the scalarizer. */ /* Initialize the scalarizer. */
gfc_init_loopinfo (&loop); gfc_init_loopinfo (&loop);
...@@ -2717,10 +2715,8 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, tree mask, ...@@ -2717,10 +2715,8 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, tree mask,
} }
else else
{ {
if (lse.ss != gfc_ss_terminator) gcc_assert (lse.ss == gfc_ss_terminator
abort (); && rse.ss == gfc_ss_terminator);
if (rse.ss != gfc_ss_terminator)
abort ();
if (loop.temp_ss != NULL) if (loop.temp_ss != NULL)
{ {
...@@ -2744,11 +2740,8 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, tree mask, ...@@ -2744,11 +2740,8 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, tree mask,
gfc_advance_se_ss_chain (&rse); gfc_advance_se_ss_chain (&rse);
gfc_conv_expr (&lse, expr1); gfc_conv_expr (&lse, expr1);
if (lse.ss != gfc_ss_terminator) gcc_assert (lse.ss == gfc_ss_terminator
abort (); && rse.ss == gfc_ss_terminator);
if (rse.ss != gfc_ss_terminator)
abort ();
/* Form the mask expression according to the mask tree list. */ /* Form the mask expression according to the mask tree list. */
index = count2; index = count2;
...@@ -2923,7 +2916,7 @@ gfc_trans_where_2 (gfc_code * code, tree mask, tree pmask, ...@@ -2923,7 +2916,7 @@ gfc_trans_where_2 (gfc_code * code, tree mask, tree pmask,
break; break;
default: default:
abort (); gcc_unreachable ();
} }
/* The next statement within the same where-body-construct. */ /* The next statement within the same where-body-construct. */
...@@ -3051,7 +3044,7 @@ gfc_trans_allocate (gfc_code * code) ...@@ -3051,7 +3044,7 @@ gfc_trans_allocate (gfc_code * code)
/* Find the last reference in the chain. */ /* Find the last reference in the chain. */
while (ref && ref->next != NULL) while (ref && ref->next != NULL)
{ {
assert (ref->type != REF_ARRAY || ref->u.ar.type == AR_ELEMENT); gcc_assert (ref->type != REF_ARRAY || ref->u.ar.type == AR_ELEMENT);
ref = ref->next; ref = ref->next;
} }
...@@ -3122,7 +3115,7 @@ gfc_trans_deallocate (gfc_code * code) ...@@ -3122,7 +3115,7 @@ gfc_trans_deallocate (gfc_code * code)
for (al = code->ext.alloc_list; al != NULL; al = al->next) for (al = code->ext.alloc_list; al != NULL; al = al->next)
{ {
expr = al->expr; expr = al->expr;
assert (expr->expr_type == EXPR_VARIABLE); gcc_assert (expr->expr_type == EXPR_VARIABLE);
gfc_init_se (&se, NULL); gfc_init_se (&se, NULL);
gfc_start_block (&se.pre); gfc_start_block (&se.pre);
......
...@@ -35,7 +35,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -35,7 +35,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "trans-types.h" #include "trans-types.h"
#include "trans-const.h" #include "trans-const.h"
#include "real.h" #include "real.h"
#include <assert.h>
#if (GFC_MAX_DIMENSIONS < 10) #if (GFC_MAX_DIMENSIONS < 10)
...@@ -114,8 +113,7 @@ gfc_init_kinds (void) ...@@ -114,8 +113,7 @@ gfc_init_kinds (void)
if (bitsize > 2*HOST_BITS_PER_WIDE_INT) if (bitsize > 2*HOST_BITS_PER_WIDE_INT)
continue; continue;
if (i_index == MAX_INT_KINDS) gcc_assert (i_index != MAX_INT_KINDS);
abort ();
/* Let the kind equal the bit size divided by 8. This insulates the /* Let the kind equal the bit size divided by 8. This insulates the
programmer from the underlying byte size. */ programmer from the underlying byte size. */
...@@ -170,11 +168,9 @@ gfc_init_kinds (void) ...@@ -170,11 +168,9 @@ gfc_init_kinds (void)
saw_r16 = true; saw_r16 = true;
/* Careful we don't stumble a wierd internal mode. */ /* Careful we don't stumble a wierd internal mode. */
if (r_index > 0 && gfc_real_kinds[r_index-1].kind == kind) gcc_assert (r_index <= 0 || gfc_real_kinds[r_index-1].kind != kind);
abort ();
/* Or have too many modes for the allocated space. */ /* Or have too many modes for the allocated space. */
if (r_index == MAX_REAL_KINDS) gcc_assert (r_index != MAX_REAL_KINDS);
abort ();
gfc_real_kinds[r_index].kind = kind; gfc_real_kinds[r_index].kind = kind;
gfc_real_kinds[r_index].radix = fmt->b; gfc_real_kinds[r_index].radix = fmt->b;
...@@ -442,7 +438,7 @@ c_size_t_size (void) ...@@ -442,7 +438,7 @@ c_size_t_size (void)
return LONG_TYPE_SIZE; return LONG_TYPE_SIZE;
if (strcmp (SIZE_TYPE, "short unsigned int") == 0) if (strcmp (SIZE_TYPE, "short unsigned int") == 0)
return SHORT_TYPE_SIZE; return SHORT_TYPE_SIZE;
abort (); gcc_unreachable ();
#else #else
return LONG_TYPE_SIZE; return LONG_TYPE_SIZE;
#endif #endif
...@@ -614,8 +610,7 @@ gfc_typenode_for_spec (gfc_typespec * spec) ...@@ -614,8 +610,7 @@ gfc_typenode_for_spec (gfc_typespec * spec)
switch (spec->type) switch (spec->type)
{ {
case BT_UNKNOWN: case BT_UNKNOWN:
abort (); gcc_unreachable ();
break;
case BT_INTEGER: case BT_INTEGER:
basetype = gfc_get_int_type (spec->kind); basetype = gfc_get_int_type (spec->kind);
...@@ -642,8 +637,7 @@ gfc_typenode_for_spec (gfc_typespec * spec) ...@@ -642,8 +637,7 @@ gfc_typenode_for_spec (gfc_typespec * spec)
break; break;
default: default:
abort (); gcc_unreachable ();
break;
} }
return basetype; return basetype;
} }
...@@ -670,18 +664,18 @@ gfc_get_element_type (tree type) ...@@ -670,18 +664,18 @@ gfc_get_element_type (tree type)
{ {
if (TREE_CODE (type) == POINTER_TYPE) if (TREE_CODE (type) == POINTER_TYPE)
type = TREE_TYPE (type); type = TREE_TYPE (type);
assert (TREE_CODE (type) == ARRAY_TYPE); gcc_assert (TREE_CODE (type) == ARRAY_TYPE);
element = TREE_TYPE (type); element = TREE_TYPE (type);
} }
else else
{ {
assert (GFC_DESCRIPTOR_TYPE_P (type)); gcc_assert (GFC_DESCRIPTOR_TYPE_P (type));
element = TREE_TYPE (TYPE_FIELDS (type)); element = TREE_TYPE (TYPE_FIELDS (type));
assert (TREE_CODE (element) == POINTER_TYPE); gcc_assert (TREE_CODE (element) == POINTER_TYPE);
element = TREE_TYPE (element); element = TREE_TYPE (element);
assert (TREE_CODE (element) == ARRAY_TYPE); gcc_assert (TREE_CODE (element) == ARRAY_TYPE);
element = TREE_TYPE (element); element = TREE_TYPE (element);
} }
...@@ -763,7 +757,7 @@ gfc_get_element_type (tree type) ...@@ -763,7 +757,7 @@ gfc_get_element_type (tree type)
int int
gfc_is_nodesc_array (gfc_symbol * sym) gfc_is_nodesc_array (gfc_symbol * sym)
{ {
assert (sym->attr.dimension); gcc_assert (sym->attr.dimension);
/* We only want local arrays. */ /* We only want local arrays. */
if (sym->attr.pointer || sym->attr.allocatable) if (sym->attr.pointer || sym->attr.allocatable)
...@@ -783,7 +777,7 @@ gfc_is_nodesc_array (gfc_symbol * sym) ...@@ -783,7 +777,7 @@ gfc_is_nodesc_array (gfc_symbol * sym)
if (sym->attr.pointer || sym->attr.allocatable) if (sym->attr.pointer || sym->attr.allocatable)
return 0; return 0;
assert (sym->as->type == AS_EXPLICIT); gcc_assert (sym->as->type == AS_EXPLICIT);
return 1; return 1;
} }
...@@ -900,7 +894,7 @@ gfc_get_dtype (tree type, int rank) ...@@ -900,7 +894,7 @@ gfc_get_dtype (tree type, int rank)
return gfc_index_zero_node; return gfc_index_zero_node;
} }
assert (rank <= GFC_DTYPE_RANK_MASK); gcc_assert (rank <= GFC_DTYPE_RANK_MASK);
size = TYPE_SIZE_UNIT (type); size = TYPE_SIZE_UNIT (type);
i = rank | (n << GFC_DTYPE_TYPE_SHIFT); i = rank | (n << GFC_DTYPE_TYPE_SHIFT);
...@@ -1155,7 +1149,7 @@ gfc_get_array_type_bounds (tree etype, int dimen, tree * lbound, ...@@ -1155,7 +1149,7 @@ gfc_get_array_type_bounds (tree etype, int dimen, tree * lbound,
stride = stride =
fold (build2 (MULT_EXPR, gfc_array_index_type, tmp, stride)); fold (build2 (MULT_EXPR, gfc_array_index_type, tmp, stride));
/* Check the folding worked. */ /* Check the folding worked. */
assert (INTEGER_CST_P (stride)); gcc_assert (INTEGER_CST_P (stride));
} }
else else
stride = NULL_TREE; stride = NULL_TREE;
...@@ -1347,7 +1341,7 @@ gfc_get_derived_type (gfc_symbol * derived) ...@@ -1347,7 +1341,7 @@ gfc_get_derived_type (gfc_symbol * derived)
tree typenode, field, field_type, fieldlist; tree typenode, field, field_type, fieldlist;
gfc_component *c; gfc_component *c;
assert (derived && derived->attr.flavor == FL_DERIVED); gcc_assert (derived && derived->attr.flavor == FL_DERIVED);
/* derived->backend_decl != 0 means we saw it before, but its /* derived->backend_decl != 0 means we saw it before, but its
components' backend_decl may have not been built. */ components' backend_decl may have not been built. */
...@@ -1392,7 +1386,7 @@ gfc_get_derived_type (gfc_symbol * derived) ...@@ -1392,7 +1386,7 @@ gfc_get_derived_type (gfc_symbol * derived)
{ {
/* Evaluate the string length. */ /* Evaluate the string length. */
gfc_conv_const_charlen (c->ts.cl); gfc_conv_const_charlen (c->ts.cl);
assert (c->ts.cl->backend_decl); gcc_assert (c->ts.cl->backend_decl);
} }
field_type = gfc_typenode_for_spec (&c->ts); field_type = gfc_typenode_for_spec (&c->ts);
...@@ -1420,7 +1414,7 @@ gfc_get_derived_type (gfc_symbol * derived) ...@@ -1420,7 +1414,7 @@ gfc_get_derived_type (gfc_symbol * derived)
DECL_PACKED (field) |= TYPE_PACKED (typenode); DECL_PACKED (field) |= TYPE_PACKED (typenode);
assert (!c->backend_decl); gcc_assert (!c->backend_decl);
c->backend_decl = field; c->backend_decl = field;
} }
...@@ -1441,7 +1435,7 @@ gfc_return_by_reference (gfc_symbol * sym) ...@@ -1441,7 +1435,7 @@ gfc_return_by_reference (gfc_symbol * sym)
if (!sym->attr.function) if (!sym->attr.function)
return 0; return 0;
assert (sym->attr.function); gcc_assert (sym->attr.function);
if (sym->result) if (sym->result)
sym = sym->result; sym = sym->result;
...@@ -1467,7 +1461,7 @@ gfc_get_function_type (gfc_symbol * sym) ...@@ -1467,7 +1461,7 @@ gfc_get_function_type (gfc_symbol * sym)
int alternate_return; int alternate_return;
/* Make sure this symbol is a function or a subroutine. */ /* Make sure this symbol is a function or a subroutine. */
assert (sym->attr.flavor == FL_PROCEDURE); gcc_assert (sym->attr.flavor == FL_PROCEDURE);
if (sym->backend_decl) if (sym->backend_decl)
return TREE_TYPE (sym->backend_decl); return TREE_TYPE (sym->backend_decl);
......
...@@ -30,7 +30,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -30,7 +30,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "defaults.h" #include "defaults.h"
#include "real.h" #include "real.h"
#include <gmp.h> #include <gmp.h>
#include <assert.h>
#include "gfortran.h" #include "gfortran.h"
#include "trans.h" #include "trans.h"
#include "trans-stmt.h" #include "trans-stmt.h"
...@@ -56,7 +55,7 @@ gfc_advance_chain (tree t, int n) ...@@ -56,7 +55,7 @@ gfc_advance_chain (tree t, int n)
{ {
for (; n > 0; n--) for (; n > 0; n--)
{ {
assert (t != NULL_TREE); gcc_assert (t != NULL_TREE);
t = TREE_CHAIN (t); t = TREE_CHAIN (t);
} }
return t; return t;
...@@ -151,9 +150,8 @@ gfc_add_modify_expr (stmtblock_t * pblock, tree lhs, tree rhs) ...@@ -151,9 +150,8 @@ gfc_add_modify_expr (stmtblock_t * pblock, tree lhs, tree rhs)
for scalar assignments. We should probably have something for scalar assignments. We should probably have something
similar for aggregates, but right now removing that check just similar for aggregates, but right now removing that check just
breaks everything. */ breaks everything. */
if (TREE_TYPE (rhs) != TREE_TYPE (lhs) gcc_assert (TREE_TYPE (rhs) == TREE_TYPE (lhs)
&& !AGGREGATE_TYPE_P (TREE_TYPE (lhs))) || AGGREGATE_TYPE_P (TREE_TYPE (lhs)));
abort ();
#endif #endif
tmp = fold (build2_v (MODIFY_EXPR, lhs, rhs)); tmp = fold (build2_v (MODIFY_EXPR, lhs, rhs));
...@@ -197,7 +195,7 @@ gfc_merge_block_scope (stmtblock_t * block) ...@@ -197,7 +195,7 @@ gfc_merge_block_scope (stmtblock_t * block)
tree decl; tree decl;
tree next; tree next;
assert (block->has_scope); gcc_assert (block->has_scope);
block->has_scope = 0; block->has_scope = 0;
/* Remember the decls in this scope. */ /* Remember the decls in this scope. */
...@@ -292,8 +290,7 @@ tree ...@@ -292,8 +290,7 @@ tree
gfc_build_indirect_ref (tree t) gfc_build_indirect_ref (tree t)
{ {
tree type = TREE_TYPE (t); tree type = TREE_TYPE (t);
if (!POINTER_TYPE_P (type)) gcc_assert (POINTER_TYPE_P (type));
abort ();
type = TREE_TYPE (type); type = TREE_TYPE (type);
if (TREE_CODE (t) == ADDR_EXPR) if (TREE_CODE (t) == ADDR_EXPR)
...@@ -309,8 +306,7 @@ tree ...@@ -309,8 +306,7 @@ tree
gfc_build_array_ref (tree base, tree offset) gfc_build_array_ref (tree base, tree offset)
{ {
tree type = TREE_TYPE (base); tree type = TREE_TYPE (base);
if (TREE_CODE (type) != ARRAY_TYPE) gcc_assert (TREE_CODE (type) == ARRAY_TYPE);
abort ();
type = TREE_TYPE (type); type = TREE_TYPE (type);
if (DECL_P (base)) if (DECL_P (base))
...@@ -356,7 +352,7 @@ gfc_trans_runtime_check (tree cond, tree msg, stmtblock_t * pblock) ...@@ -356,7 +352,7 @@ gfc_trans_runtime_check (tree cond, tree msg, stmtblock_t * pblock)
/* The code to generate the error. */ /* The code to generate the error. */
gfc_start_block (&block); gfc_start_block (&block);
assert (TREE_CODE (msg) == STRING_CST); gcc_assert (TREE_CODE (msg) == STRING_CST);
TREE_USED (msg) = 1; TREE_USED (msg) = 1;
...@@ -396,7 +392,7 @@ gfc_trans_runtime_check (tree cond, tree msg, stmtblock_t * pblock) ...@@ -396,7 +392,7 @@ gfc_trans_runtime_check (tree cond, tree msg, stmtblock_t * pblock)
void void
gfc_add_expr_to_block (stmtblock_t * block, tree expr) gfc_add_expr_to_block (stmtblock_t * block, tree expr)
{ {
assert (block); gcc_assert (block);
if (expr == NULL_TREE || IS_EMPTY_STMT (expr)) if (expr == NULL_TREE || IS_EMPTY_STMT (expr))
return; return;
...@@ -427,8 +423,8 @@ gfc_add_expr_to_block (stmtblock_t * block, tree expr) ...@@ -427,8 +423,8 @@ gfc_add_expr_to_block (stmtblock_t * block, tree expr)
void void
gfc_add_block_to_block (stmtblock_t * block, stmtblock_t * append) gfc_add_block_to_block (stmtblock_t * block, stmtblock_t * append)
{ {
assert (append); gcc_assert (append);
assert (!append->has_scope); gcc_assert (!append->has_scope);
gfc_add_expr_to_block (block, append->head); gfc_add_expr_to_block (block, append->head);
append->head = NULL_TREE; append->head = NULL_TREE;
......
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