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);
......
...@@ -86,7 +86,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -86,7 +86,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "toplev.h" #include "toplev.h"
#include "real.h" #include "real.h"
#include "flags.h" #include "flags.h"
#include <assert.h>
#include <gmp.h> #include <gmp.h>
#include "gfortran.h" #include "gfortran.h"
#include "trans.h" #include "trans.h"
...@@ -181,11 +180,11 @@ gfc_conv_descriptor_data (tree desc) ...@@ -181,11 +180,11 @@ gfc_conv_descriptor_data (tree desc)
tree type; tree type;
type = TREE_TYPE (desc); type = TREE_TYPE (desc);
assert (GFC_DESCRIPTOR_TYPE_P (type)); gcc_assert (GFC_DESCRIPTOR_TYPE_P (type));
field = TYPE_FIELDS (type); field = TYPE_FIELDS (type);
assert (DATA_FIELD == 0); gcc_assert (DATA_FIELD == 0);
assert (field != NULL_TREE gcc_assert (field != NULL_TREE
&& TREE_CODE (TREE_TYPE (field)) == POINTER_TYPE && TREE_CODE (TREE_TYPE (field)) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (TREE_TYPE (field))) == ARRAY_TYPE); && TREE_CODE (TREE_TYPE (TREE_TYPE (field))) == ARRAY_TYPE);
...@@ -199,10 +198,10 @@ gfc_conv_descriptor_offset (tree desc) ...@@ -199,10 +198,10 @@ gfc_conv_descriptor_offset (tree desc)
tree field; tree field;
type = TREE_TYPE (desc); type = TREE_TYPE (desc);
assert (GFC_DESCRIPTOR_TYPE_P (type)); gcc_assert (GFC_DESCRIPTOR_TYPE_P (type));
field = gfc_advance_chain (TYPE_FIELDS (type), OFFSET_FIELD); field = gfc_advance_chain (TYPE_FIELDS (type), OFFSET_FIELD);
assert (field != NULL_TREE && TREE_TYPE (field) == gfc_array_index_type); gcc_assert (field != NULL_TREE && TREE_TYPE (field) == gfc_array_index_type);
return build3 (COMPONENT_REF, TREE_TYPE (field), desc, field, NULL_TREE); return build3 (COMPONENT_REF, TREE_TYPE (field), desc, field, NULL_TREE);
} }
...@@ -214,10 +213,10 @@ gfc_conv_descriptor_dtype (tree desc) ...@@ -214,10 +213,10 @@ gfc_conv_descriptor_dtype (tree desc)
tree type; tree type;
type = TREE_TYPE (desc); type = TREE_TYPE (desc);
assert (GFC_DESCRIPTOR_TYPE_P (type)); gcc_assert (GFC_DESCRIPTOR_TYPE_P (type));
field = gfc_advance_chain (TYPE_FIELDS (type), DTYPE_FIELD); field = gfc_advance_chain (TYPE_FIELDS (type), DTYPE_FIELD);
assert (field != NULL_TREE && TREE_TYPE (field) == gfc_array_index_type); gcc_assert (field != NULL_TREE && TREE_TYPE (field) == gfc_array_index_type);
return build3 (COMPONENT_REF, TREE_TYPE (field), desc, field, NULL_TREE); return build3 (COMPONENT_REF, TREE_TYPE (field), desc, field, NULL_TREE);
} }
...@@ -230,10 +229,10 @@ gfc_conv_descriptor_dimension (tree desc, tree dim) ...@@ -230,10 +229,10 @@ gfc_conv_descriptor_dimension (tree desc, tree dim)
tree tmp; tree tmp;
type = TREE_TYPE (desc); type = TREE_TYPE (desc);
assert (GFC_DESCRIPTOR_TYPE_P (type)); gcc_assert (GFC_DESCRIPTOR_TYPE_P (type));
field = gfc_advance_chain (TYPE_FIELDS (type), DIMENSION_FIELD); field = gfc_advance_chain (TYPE_FIELDS (type), DIMENSION_FIELD);
assert (field != NULL_TREE gcc_assert (field != NULL_TREE
&& TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE && TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE
&& TREE_CODE (TREE_TYPE (TREE_TYPE (field))) == RECORD_TYPE); && TREE_CODE (TREE_TYPE (TREE_TYPE (field))) == RECORD_TYPE);
...@@ -251,7 +250,7 @@ gfc_conv_descriptor_stride (tree desc, tree dim) ...@@ -251,7 +250,7 @@ gfc_conv_descriptor_stride (tree desc, tree dim)
tmp = gfc_conv_descriptor_dimension (desc, dim); tmp = gfc_conv_descriptor_dimension (desc, dim);
field = TYPE_FIELDS (TREE_TYPE (tmp)); field = TYPE_FIELDS (TREE_TYPE (tmp));
field = gfc_advance_chain (field, STRIDE_SUBFIELD); field = gfc_advance_chain (field, STRIDE_SUBFIELD);
assert (field != NULL_TREE && TREE_TYPE (field) == gfc_array_index_type); gcc_assert (field != NULL_TREE && TREE_TYPE (field) == gfc_array_index_type);
tmp = build3 (COMPONENT_REF, TREE_TYPE (field), tmp, field, NULL_TREE); tmp = build3 (COMPONENT_REF, TREE_TYPE (field), tmp, field, NULL_TREE);
return tmp; return tmp;
...@@ -266,7 +265,7 @@ gfc_conv_descriptor_lbound (tree desc, tree dim) ...@@ -266,7 +265,7 @@ gfc_conv_descriptor_lbound (tree desc, tree dim)
tmp = gfc_conv_descriptor_dimension (desc, dim); tmp = gfc_conv_descriptor_dimension (desc, dim);
field = TYPE_FIELDS (TREE_TYPE (tmp)); field = TYPE_FIELDS (TREE_TYPE (tmp));
field = gfc_advance_chain (field, LBOUND_SUBFIELD); field = gfc_advance_chain (field, LBOUND_SUBFIELD);
assert (field != NULL_TREE && TREE_TYPE (field) == gfc_array_index_type); gcc_assert (field != NULL_TREE && TREE_TYPE (field) == gfc_array_index_type);
tmp = build3 (COMPONENT_REF, TREE_TYPE (field), tmp, field, NULL_TREE); tmp = build3 (COMPONENT_REF, TREE_TYPE (field), tmp, field, NULL_TREE);
return tmp; return tmp;
...@@ -281,7 +280,7 @@ gfc_conv_descriptor_ubound (tree desc, tree dim) ...@@ -281,7 +280,7 @@ gfc_conv_descriptor_ubound (tree desc, tree dim)
tmp = gfc_conv_descriptor_dimension (desc, dim); tmp = gfc_conv_descriptor_dimension (desc, dim);
field = TYPE_FIELDS (TREE_TYPE (tmp)); field = TYPE_FIELDS (TREE_TYPE (tmp));
field = gfc_advance_chain (field, UBOUND_SUBFIELD); field = gfc_advance_chain (field, UBOUND_SUBFIELD);
assert (field != NULL_TREE && TREE_TYPE (field) == gfc_array_index_type); gcc_assert (field != NULL_TREE && TREE_TYPE (field) == gfc_array_index_type);
tmp = build3 (COMPONENT_REF, TREE_TYPE (field), tmp, field, NULL_TREE); tmp = build3 (COMPONENT_REF, TREE_TYPE (field), tmp, field, NULL_TREE);
return tmp; return tmp;
...@@ -296,8 +295,8 @@ gfc_build_null_descriptor (tree type) ...@@ -296,8 +295,8 @@ gfc_build_null_descriptor (tree type)
tree field; tree field;
tree tmp; tree tmp;
assert (GFC_DESCRIPTOR_TYPE_P (type)); gcc_assert (GFC_DESCRIPTOR_TYPE_P (type));
assert (DATA_FIELD == 0); gcc_assert (DATA_FIELD == 0);
field = TYPE_FIELDS (type); field = TYPE_FIELDS (type);
/* Set a NULL data pointer. */ /* Set a NULL data pointer. */
...@@ -345,7 +344,7 @@ gfc_free_ss_chain (gfc_ss * ss) ...@@ -345,7 +344,7 @@ gfc_free_ss_chain (gfc_ss * ss)
while (ss != gfc_ss_terminator) while (ss != gfc_ss_terminator)
{ {
assert (ss != NULL); gcc_assert (ss != NULL);
next = ss->next; next = ss->next;
gfc_free_ss (ss); gfc_free_ss (ss);
ss = next; ss = next;
...@@ -390,7 +389,7 @@ gfc_cleanup_loop (gfc_loopinfo * loop) ...@@ -390,7 +389,7 @@ gfc_cleanup_loop (gfc_loopinfo * loop)
ss = loop->ss; ss = loop->ss;
while (ss != gfc_ss_terminator) while (ss != gfc_ss_terminator)
{ {
assert (ss != NULL); gcc_assert (ss != NULL);
next = ss->loop_chain; next = ss->loop_chain;
gfc_free_ss (ss); gfc_free_ss (ss);
ss = next; ss = next;
...@@ -416,7 +415,7 @@ gfc_add_ss_to_loop (gfc_loopinfo * loop, gfc_ss * head) ...@@ -416,7 +415,7 @@ gfc_add_ss_to_loop (gfc_loopinfo * loop, gfc_ss * head)
else else
ss->loop_chain = ss->next; ss->loop_chain = ss->next;
} }
assert (ss == gfc_ss_terminator); gcc_assert (ss == gfc_ss_terminator);
loop->ss = head; loop->ss = head;
} }
...@@ -428,7 +427,7 @@ gfc_trans_static_array_pointer (gfc_symbol * sym) ...@@ -428,7 +427,7 @@ gfc_trans_static_array_pointer (gfc_symbol * sym)
{ {
tree type; tree type;
assert (TREE_STATIC (sym->backend_decl)); gcc_assert (TREE_STATIC (sym->backend_decl));
/* Just zero the data member. */ /* Just zero the data member. */
type = TREE_TYPE (sym->backend_decl); type = TREE_TYPE (sym->backend_decl);
DECL_INITIAL (sym->backend_decl) =gfc_build_null_descriptor (type); DECL_INITIAL (sym->backend_decl) =gfc_build_null_descriptor (type);
...@@ -492,7 +491,7 @@ gfc_trans_allocate_array_storage (gfc_loopinfo * loop, gfc_ss_info * info, ...@@ -492,7 +491,7 @@ gfc_trans_allocate_array_storage (gfc_loopinfo * loop, gfc_ss_info * info,
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 (data), tmp); tmp = convert (TREE_TYPE (data), tmp);
gfc_add_modify_expr (&loop->pre, data, tmp); gfc_add_modify_expr (&loop->pre, data, tmp);
...@@ -537,13 +536,13 @@ gfc_trans_allocate_temp_array (gfc_loopinfo * loop, gfc_ss_info * info, ...@@ -537,13 +536,13 @@ gfc_trans_allocate_temp_array (gfc_loopinfo * loop, gfc_ss_info * info,
int n; int n;
int dim; int dim;
assert (info->dimen > 0); gcc_assert (info->dimen > 0);
/* Set the lower bound to zero. */ /* Set the lower bound to zero. */
for (dim = 0; dim < info->dimen; dim++) for (dim = 0; dim < info->dimen; dim++)
{ {
n = loop->order[dim]; n = loop->order[dim];
if (n < loop->temp_dim) if (n < loop->temp_dim)
assert (integer_zerop (loop->from[n])); gcc_assert (integer_zerop (loop->from[n]));
else else
{ {
/* Callee allocated arrays may not have a known bound yet. */ /* Callee allocated arrays may not have a known bound yet. */
...@@ -640,7 +639,7 @@ gfc_put_offset_into_var (stmtblock_t * pblock, tree * poffset, ...@@ -640,7 +639,7 @@ gfc_put_offset_into_var (stmtblock_t * pblock, tree * poffset,
{ {
/* We should have already created the offset variable. We cannot /* We should have already created the offset variable. We cannot
create it here because we may be in an inner scope. */ create it here because we may be in an inner scope. */
assert (*offsetvar != NULL_TREE); gcc_assert (*offsetvar != NULL_TREE);
gfc_add_modify_expr (pblock, *offsetvar, *poffset); gfc_add_modify_expr (pblock, *offsetvar, *poffset);
*poffset = *offsetvar; *poffset = *offsetvar;
TREE_USED (*offsetvar) = 1; TREE_USED (*offsetvar) = 1;
...@@ -717,7 +716,7 @@ gfc_trans_array_constructor_subarray (stmtblock_t * pblock, ...@@ -717,7 +716,7 @@ gfc_trans_array_constructor_subarray (stmtblock_t * pblock,
/* Walk the array expression. */ /* Walk the array expression. */
ss = gfc_walk_expr (expr); ss = gfc_walk_expr (expr);
assert (ss != gfc_ss_terminator); gcc_assert (ss != gfc_ss_terminator);
/* Initialize the scalarizer. */ /* Initialize the scalarizer. */
gfc_init_loopinfo (&loop); gfc_init_loopinfo (&loop);
...@@ -737,7 +736,7 @@ gfc_trans_array_constructor_subarray (stmtblock_t * pblock, ...@@ -737,7 +736,7 @@ gfc_trans_array_constructor_subarray (stmtblock_t * pblock,
gfc_todo_error ("character arrays in constructors"); gfc_todo_error ("character arrays in constructors");
gfc_trans_array_ctor_element (&body, pointer, *poffset, &se, expr); gfc_trans_array_ctor_element (&body, pointer, *poffset, &se, expr);
assert (se.ss == gfc_ss_terminator); gcc_assert (se.ss == gfc_ss_terminator);
/* Increment the offset. */ /* Increment the offset. */
tmp = build2 (PLUS_EXPR, gfc_array_index_type, *poffset, gfc_index_one_node); tmp = build2 (PLUS_EXPR, gfc_array_index_type, *poffset, gfc_index_one_node);
...@@ -1145,12 +1144,12 @@ gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss) ...@@ -1145,12 +1144,12 @@ gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss)
if (TREE_USED (offsetvar)) if (TREE_USED (offsetvar))
pushdecl (offsetvar); pushdecl (offsetvar);
else else
assert (INTEGER_CST_P (offset)); gcc_assert (INTEGER_CST_P (offset));
#if 0 #if 0
/* Disable bound checking for now because it's probably broken. */ /* Disable bound checking for now because it's probably broken. */
if (flag_bounds_check) if (flag_bounds_check)
{ {
abort (); gcc_unreachable ();
} }
#endif #endif
} }
...@@ -1168,11 +1167,11 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript) ...@@ -1168,11 +1167,11 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript)
/* TODO: This can generate bad code if there are ordering dependencies. /* TODO: This can generate bad code if there are ordering dependencies.
eg. a callee allocated function and an unknown size constructor. */ eg. a callee allocated function and an unknown size constructor. */
assert (ss != NULL); gcc_assert (ss != NULL);
for (; ss != gfc_ss_terminator; ss = ss->loop_chain) for (; ss != gfc_ss_terminator; ss = ss->loop_chain)
{ {
assert (ss); gcc_assert (ss);
switch (ss->type) switch (ss->type)
{ {
...@@ -1246,7 +1245,7 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript) ...@@ -1246,7 +1245,7 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
} }
...@@ -1262,7 +1261,7 @@ gfc_conv_ss_descriptor (stmtblock_t * block, gfc_ss * ss, int base) ...@@ -1262,7 +1261,7 @@ gfc_conv_ss_descriptor (stmtblock_t * block, gfc_ss * ss, int base)
tree tmp; tree tmp;
/* Get the descriptor for the array to be scalarized. */ /* Get the descriptor for the array to be scalarized. */
assert (ss->expr->expr_type == EXPR_VARIABLE); gcc_assert (ss->expr->expr_type == EXPR_VARIABLE);
gfc_init_se (&se, NULL); gfc_init_se (&se, NULL);
se.descriptor_only = 1; se.descriptor_only = 1;
gfc_conv_expr_lhs (&se, ss->expr); gfc_conv_expr_lhs (&se, ss->expr);
...@@ -1449,7 +1448,7 @@ gfc_conv_array_index_ref (gfc_se * se, tree pointer, tree * indices, ...@@ -1449,7 +1448,7 @@ gfc_conv_array_index_ref (gfc_se * se, tree pointer, tree * indices,
tmp = gfc_build_array_ref (array, index); tmp = gfc_build_array_ref (array, index);
/* Check we've used the correct number of dimensions. */ /* Check we've used the correct number of dimensions. */
assert (TREE_CODE (TREE_TYPE (tmp)) != ARRAY_TYPE); gcc_assert (TREE_CODE (TREE_TYPE (tmp)) != ARRAY_TYPE);
se->expr = tmp; se->expr = tmp;
} }
...@@ -1494,7 +1493,7 @@ gfc_conv_vector_array_index (gfc_se * se, tree index, gfc_ss * ss) ...@@ -1494,7 +1493,7 @@ gfc_conv_vector_array_index (gfc_se * se, tree index, gfc_ss * ss)
gfc_ss_info *info; gfc_ss_info *info;
int n; int n;
assert (ss && ss->type == GFC_SS_VECTOR); gcc_assert (ss && ss->type == GFC_SS_VECTOR);
/* Save the descriptor. */ /* Save the descriptor. */
descsave = se->expr; descsave = se->expr;
...@@ -1507,7 +1506,7 @@ gfc_conv_vector_array_index (gfc_se * se, tree index, gfc_ss * ss) ...@@ -1507,7 +1506,7 @@ gfc_conv_vector_array_index (gfc_se * se, tree index, gfc_ss * ss)
switch (ar->dimen_type[n]) switch (ar->dimen_type[n])
{ {
case DIMEN_ELEMENT: case DIMEN_ELEMENT:
assert (info->subscript[n] != gfc_ss_terminator gcc_assert (info->subscript[n] != gfc_ss_terminator
&& info->subscript[n]->type == GFC_SS_SCALAR); && info->subscript[n]->type == GFC_SS_SCALAR);
indices[n] = info->subscript[n]->data.scalar.expr; indices[n] = info->subscript[n]->data.scalar.expr;
break; break;
...@@ -1524,7 +1523,7 @@ gfc_conv_vector_array_index (gfc_se * se, tree index, gfc_ss * ss) ...@@ -1524,7 +1523,7 @@ gfc_conv_vector_array_index (gfc_se * se, tree index, gfc_ss * ss)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
/* Get the index from the vector. */ /* Get the index from the vector. */
...@@ -1549,12 +1548,12 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i, ...@@ -1549,12 +1548,12 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
/* Get the index into the array for this dimension. */ /* Get the index into the array for this dimension. */
if (ar) if (ar)
{ {
assert (ar->type != AR_ELEMENT); gcc_assert (ar->type != AR_ELEMENT);
if (ar->dimen_type[dim] == DIMEN_ELEMENT) if (ar->dimen_type[dim] == DIMEN_ELEMENT)
{ {
assert (i == -1); gcc_assert (i == -1);
/* Elemental dimension. */ /* Elemental dimension. */
assert (info->subscript[dim] gcc_assert (info->subscript[dim]
&& info->subscript[dim]->type == GFC_SS_SCALAR); && info->subscript[dim]->type == GFC_SS_SCALAR);
/* We've already translated this value outside the loop. */ /* We've already translated this value outside the loop. */
index = info->subscript[dim]->data.scalar.expr; index = info->subscript[dim]->data.scalar.expr;
...@@ -1565,7 +1564,7 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i, ...@@ -1565,7 +1564,7 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
else else
{ {
/* Scalarized dimension. */ /* Scalarized dimension. */
assert (info && se->loop); gcc_assert (info && se->loop);
/* Multiply the loop variable by the stride and dela. */ /* Multiply the loop variable by the stride and dela. */
index = se->loop->loopvar[i]; index = se->loop->loopvar[i];
...@@ -1584,13 +1583,13 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i, ...@@ -1584,13 +1583,13 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
dim); dim);
} }
else else
assert (ar->dimen_type[dim] == DIMEN_RANGE); gcc_assert (ar->dimen_type[dim] == DIMEN_RANGE);
} }
} }
else else
{ {
/* Temporary array or derived type component. */ /* Temporary array or derived type component. */
assert (se->loop); gcc_assert (se->loop);
index = se->loop->loopvar[se->loop->order[i]]; index = se->loop->loopvar[se->loop->order[i]];
if (!integer_zerop (info->delta[i])) if (!integer_zerop (info->delta[i]))
index = fold (build2 (PLUS_EXPR, gfc_array_index_type, index = fold (build2 (PLUS_EXPR, gfc_array_index_type,
...@@ -1832,7 +1831,7 @@ gfc_start_scalarized_body (gfc_loopinfo * loop, stmtblock_t * pbody) ...@@ -1832,7 +1831,7 @@ gfc_start_scalarized_body (gfc_loopinfo * loop, stmtblock_t * pbody)
int n; int n;
int flags; int flags;
assert (!loop->array_parameter); gcc_assert (!loop->array_parameter);
for (dim = loop->dimen - 1; dim >= 0; dim--) for (dim = loop->dimen - 1; dim >= 0; dim--)
{ {
...@@ -2000,7 +1999,7 @@ gfc_conv_section_upper_bound (gfc_ss * ss, int n, stmtblock_t * pblock) ...@@ -2000,7 +1999,7 @@ gfc_conv_section_upper_bound (gfc_ss * ss, int n, stmtblock_t * pblock)
tree bound; tree bound;
gfc_se se; gfc_se se;
assert (ss->type == GFC_SS_SECTION); gcc_assert (ss->type == GFC_SS_SECTION);
/* For vector array subscripts we want the size of the vector. */ /* For vector array subscripts we want the size of the vector. */
dim = ss->data.info.dim[n]; dim = ss->data.info.dim[n];
...@@ -2008,11 +2007,11 @@ gfc_conv_section_upper_bound (gfc_ss * ss, int n, stmtblock_t * pblock) ...@@ -2008,11 +2007,11 @@ gfc_conv_section_upper_bound (gfc_ss * ss, int n, stmtblock_t * pblock)
while (vecss->data.info.ref->u.ar.dimen_type[dim] == DIMEN_VECTOR) while (vecss->data.info.ref->u.ar.dimen_type[dim] == DIMEN_VECTOR)
{ {
vecss = vecss->data.info.subscript[dim]; vecss = vecss->data.info.subscript[dim];
assert (vecss && vecss->type == GFC_SS_VECTOR); gcc_assert (vecss && vecss->type == GFC_SS_VECTOR);
dim = vecss->data.info.dim[0]; dim = vecss->data.info.dim[0];
} }
assert (vecss->data.info.ref->u.ar.dimen_type[dim] == DIMEN_RANGE); gcc_assert (vecss->data.info.ref->u.ar.dimen_type[dim] == DIMEN_RANGE);
end = vecss->data.info.ref->u.ar.end[dim]; end = vecss->data.info.ref->u.ar.end[dim];
desc = vecss->data.info.descriptor; desc = vecss->data.info.descriptor;
...@@ -2056,14 +2055,14 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int n) ...@@ -2056,14 +2055,14 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int n)
while (vecss->data.info.ref->u.ar.dimen_type[dim] == DIMEN_VECTOR) while (vecss->data.info.ref->u.ar.dimen_type[dim] == DIMEN_VECTOR)
{ {
vecss = vecss->data.info.subscript[dim]; vecss = vecss->data.info.subscript[dim];
assert (vecss && vecss->type == GFC_SS_VECTOR); gcc_assert (vecss && vecss->type == GFC_SS_VECTOR);
/* Get the descriptors for the vector subscripts as well. */ /* Get the descriptors for the vector subscripts as well. */
if (!vecss->data.info.descriptor) if (!vecss->data.info.descriptor)
gfc_conv_ss_descriptor (&loop->pre, vecss, !loop->array_parameter); gfc_conv_ss_descriptor (&loop->pre, vecss, !loop->array_parameter);
dim = vecss->data.info.dim[0]; dim = vecss->data.info.dim[0];
} }
assert (vecss->data.info.ref->u.ar.dimen_type[dim] == DIMEN_RANGE); gcc_assert (vecss->data.info.ref->u.ar.dimen_type[dim] == DIMEN_RANGE);
start = vecss->data.info.ref->u.ar.start[dim]; start = vecss->data.info.ref->u.ar.start[dim];
stride = vecss->data.info.ref->u.ar.stride[dim]; stride = vecss->data.info.ref->u.ar.stride[dim];
desc = vecss->data.info.descriptor; desc = vecss->data.info.descriptor;
...@@ -2199,10 +2198,10 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop) ...@@ -2199,10 +2198,10 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
== DIMEN_VECTOR) == DIMEN_VECTOR)
{ {
vecss = vecss->data.info.subscript[dim]; vecss = vecss->data.info.subscript[dim];
assert (vecss && vecss->type == GFC_SS_VECTOR); gcc_assert (vecss && vecss->type == GFC_SS_VECTOR);
dim = vecss->data.info.dim[0]; dim = vecss->data.info.dim[0];
} }
assert (vecss->data.info.ref->u.ar.dimen_type[dim] gcc_assert (vecss->data.info.ref->u.ar.dimen_type[dim]
== DIMEN_RANGE); == DIMEN_RANGE);
desc = vecss->data.info.descriptor; desc = vecss->data.info.descriptor;
...@@ -2359,7 +2358,7 @@ gfc_conv_resolve_dependencies (gfc_loopinfo * loop, gfc_ss * dest, ...@@ -2359,7 +2358,7 @@ gfc_conv_resolve_dependencies (gfc_loopinfo * loop, gfc_ss * dest,
dim = 0; dim = 0;
for (n = 0; n < loop->dimen; n++) for (n = 0; n < loop->dimen; n++)
{ {
assert (loop->order[n] == n); gcc_assert (loop->order[n] == n);
if (depends[n]) if (depends[n])
loop->order[dim++] = n; loop->order[dim++] = n;
} }
...@@ -2370,7 +2369,7 @@ gfc_conv_resolve_dependencies (gfc_loopinfo * loop, gfc_ss * dest, ...@@ -2370,7 +2369,7 @@ gfc_conv_resolve_dependencies (gfc_loopinfo * loop, gfc_ss * dest,
loop->order[dim++] = n; loop->order[dim++] = n;
} }
assert (dim == loop->dimen); gcc_assert (dim == loop->dimen);
break; break;
} }
#endif #endif
...@@ -2433,7 +2432,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop) ...@@ -2433,7 +2432,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop)
/* An unknown size constructor will always be rank one. /* An unknown size constructor will always be rank one.
Higher rank constructors will either have known shape, Higher rank constructors will either have known shape,
or still be wrapped in a call to reshape. */ or still be wrapped in a call to reshape. */
assert (loop->dimen == 1); gcc_assert (loop->dimen == 1);
/* Try to figure out the size of the constructor. */ /* Try to figure out the size of the constructor. */
/* TODO: avoid this by making the frontend set the shape. */ /* TODO: avoid this by making the frontend set the shape. */
gfc_get_array_cons_size (&i, ss->expr->value.constructor); gfc_get_array_cons_size (&i, ss->expr->value.constructor);
...@@ -2519,8 +2518,8 @@ gfc_conv_loop_setup (gfc_loopinfo * loop) ...@@ -2519,8 +2518,8 @@ gfc_conv_loop_setup (gfc_loopinfo * loop)
switch (loopspec[n]->type) switch (loopspec[n]->type)
{ {
case GFC_SS_CONSTRUCTOR: case GFC_SS_CONSTRUCTOR:
assert (info->dimen == 1); gcc_assert (info->dimen == 1);
assert (loop->to[n]); gcc_assert (loop->to[n]);
break; break;
case GFC_SS_SECTION: case GFC_SS_SECTION:
...@@ -2530,11 +2529,11 @@ gfc_conv_loop_setup (gfc_loopinfo * loop) ...@@ -2530,11 +2529,11 @@ gfc_conv_loop_setup (gfc_loopinfo * loop)
case GFC_SS_FUNCTION: case GFC_SS_FUNCTION:
/* The loop bound will be set when we generate the call. */ /* The loop bound will be set when we generate the call. */
assert (loop->to[n] == NULL_TREE); gcc_assert (loop->to[n] == NULL_TREE);
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -2567,7 +2566,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop) ...@@ -2567,7 +2566,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop)
/* If we want a temporary then create it. */ /* If we want a temporary then create it. */
if (loop->temp_ss != NULL) if (loop->temp_ss != NULL)
{ {
assert (loop->temp_ss->type == GFC_SS_TEMP); gcc_assert (loop->temp_ss->type == GFC_SS_TEMP);
tmp = loop->temp_ss->data.temp.type; tmp = loop->temp_ss->data.temp.type;
len = loop->temp_ss->string_length; len = loop->temp_ss->string_length;
n = loop->temp_ss->data.temp.dimen; n = loop->temp_ss->data.temp.dimen;
...@@ -2676,7 +2675,7 @@ gfc_array_init_size (tree descriptor, int rank, tree * poffset, ...@@ -2676,7 +2675,7 @@ gfc_array_init_size (tree descriptor, int rank, tree * poffset,
se.expr = gfc_index_one_node; se.expr = gfc_index_one_node;
else else
{ {
assert (lower[n]); gcc_assert (lower[n]);
if (ubound) if (ubound)
{ {
gfc_conv_expr_type (&se, lower[n], gfc_array_index_type); gfc_conv_expr_type (&se, lower[n], gfc_array_index_type);
...@@ -2701,7 +2700,7 @@ gfc_array_init_size (tree descriptor, int rank, tree * poffset, ...@@ -2701,7 +2700,7 @@ gfc_array_init_size (tree descriptor, int rank, tree * poffset,
/* Set upper bound. */ /* Set upper bound. */
gfc_init_se (&se, NULL); gfc_init_se (&se, NULL);
assert (ubound); gcc_assert (ubound);
gfc_conv_expr_type (&se, ubound, gfc_array_index_type); gfc_conv_expr_type (&se, ubound, gfc_array_index_type);
gfc_add_block_to_block (pblock, &se.pre); gfc_add_block_to_block (pblock, &se.pre);
...@@ -2760,7 +2759,7 @@ gfc_array_allocate (gfc_se * se, gfc_ref * ref, tree pstat) ...@@ -2760,7 +2759,7 @@ gfc_array_allocate (gfc_se * se, gfc_ref * ref, tree pstat)
break; break;
case AR_FULL: case AR_FULL:
assert (ref->u.ar.as->type == AS_EXPLICIT); gcc_assert (ref->u.ar.as->type == AS_EXPLICIT);
lower = ref->u.ar.as->lower; lower = ref->u.ar.as->lower;
upper = ref->u.ar.as->upper; upper = ref->u.ar.as->upper;
...@@ -2772,7 +2771,7 @@ gfc_array_allocate (gfc_se * se, gfc_ref * ref, tree pstat) ...@@ -2772,7 +2771,7 @@ gfc_array_allocate (gfc_se * se, gfc_ref * ref, tree pstat)
break; break;
default: default:
abort (); gcc_unreachable ();
break; break;
} }
...@@ -2789,7 +2788,7 @@ gfc_array_allocate (gfc_se * se, gfc_ref * ref, tree pstat) ...@@ -2789,7 +2788,7 @@ gfc_array_allocate (gfc_se * se, gfc_ref * ref, tree pstat)
else if (TYPE_PRECISION (gfc_array_index_type) == 64) else if (TYPE_PRECISION (gfc_array_index_type) == 64)
allocate = gfor_fndecl_allocate64; allocate = gfor_fndecl_allocate64;
else else
abort (); gcc_unreachable ();
tmp = gfc_chainon_list (NULL_TREE, pointer); tmp = gfc_chainon_list (NULL_TREE, pointer);
tmp = gfc_chainon_list (tmp, size); tmp = gfc_chainon_list (tmp, size);
...@@ -2862,7 +2861,7 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr) ...@@ -2862,7 +2861,7 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr)
gfc_conv_structure (&se, expr, 1); gfc_conv_structure (&se, expr, 1);
tmp = TYPE_MAX_VALUE (TYPE_DOMAIN (type)); tmp = TYPE_MAX_VALUE (TYPE_DOMAIN (type));
assert (tmp && INTEGER_CST_P (tmp)); gcc_assert (tmp && INTEGER_CST_P (tmp));
hi = TREE_INT_CST_HIGH (tmp); hi = TREE_INT_CST_HIGH (tmp);
lo = TREE_INT_CST_LOW (tmp); lo = TREE_INT_CST_LOW (tmp);
lo++; lo++;
...@@ -2938,7 +2937,7 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr) ...@@ -2938,7 +2937,7 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr)
break; break;
default: default:
abort(); gcc_unreachable ();
} }
} }
/* We created the list in reverse order. */ /* We created the list in reverse order. */
...@@ -2946,7 +2945,7 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr) ...@@ -2946,7 +2945,7 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr)
break; break;
default: default:
abort(); gcc_unreachable ();
} }
/* Create a constructor from the list of elements. */ /* Create a constructor from the list of elements. */
...@@ -3042,14 +3041,14 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody) ...@@ -3042,14 +3041,14 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody)
tree offset; tree offset;
bool onstack; bool onstack;
assert (!(sym->attr.pointer || sym->attr.allocatable)); gcc_assert (!(sym->attr.pointer || sym->attr.allocatable));
/* Do nothing for USEd variables. */ /* Do nothing for USEd variables. */
if (sym->attr.use_assoc) if (sym->attr.use_assoc)
return fnbody; return fnbody;
type = TREE_TYPE (decl); type = TREE_TYPE (decl);
assert (GFC_ARRAY_TYPE_P (type)); gcc_assert (GFC_ARRAY_TYPE_P (type));
onstack = TREE_CODE (type) != POINTER_TYPE; onstack = TREE_CODE (type) != POINTER_TYPE;
gfc_start_block (&block); gfc_start_block (&block);
...@@ -3074,9 +3073,9 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody) ...@@ -3074,9 +3073,9 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody)
type = TREE_TYPE (type); type = TREE_TYPE (type);
assert (!sym->attr.use_assoc); gcc_assert (!sym->attr.use_assoc);
assert (!TREE_STATIC (decl)); gcc_assert (!TREE_STATIC (decl));
assert (!sym->module[0]); gcc_assert (!sym->module[0]);
if (sym->ts.type == BT_CHARACTER if (sym->ts.type == BT_CHARACTER
&& !INTEGER_CST_P (sym->ts.cl->backend_decl)) && !INTEGER_CST_P (sym->ts.cl->backend_decl))
...@@ -3097,7 +3096,7 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody) ...@@ -3097,7 +3096,7 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody)
else if (gfc_index_integer_kind == 8) else if (gfc_index_integer_kind == 8)
fndecl = gfor_fndecl_internal_malloc64; fndecl = gfor_fndecl_internal_malloc64;
else else
abort (); gcc_unreachable ();
tmp = gfc_build_function_call (fndecl, tmp); tmp = gfc_build_function_call (fndecl, tmp);
tmp = fold (convert (TREE_TYPE (decl), tmp)); tmp = fold (convert (TREE_TYPE (decl), tmp));
gfc_add_modify_expr (&block, decl, tmp); gfc_add_modify_expr (&block, decl, tmp);
...@@ -3108,7 +3107,7 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody) ...@@ -3108,7 +3107,7 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody)
/* Automatic arrays should not have initializers. */ /* Automatic arrays should not have initializers. */
assert (!sym->value); gcc_assert (!sym->value);
gfc_add_expr_to_block (&block, fnbody); gfc_add_expr_to_block (&block, fnbody);
...@@ -3140,7 +3139,7 @@ gfc_trans_g77_array (gfc_symbol * sym, tree body) ...@@ -3140,7 +3139,7 @@ gfc_trans_g77_array (gfc_symbol * sym, tree body)
/* Descriptor type. */ /* Descriptor type. */
parm = sym->backend_decl; parm = sym->backend_decl;
type = TREE_TYPE (parm); type = TREE_TYPE (parm);
assert (GFC_ARRAY_TYPE_P (type)); gcc_assert (GFC_ARRAY_TYPE_P (type));
gfc_start_block (&block); gfc_start_block (&block);
...@@ -3223,7 +3222,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) ...@@ -3223,7 +3222,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
/* Descriptor type. */ /* Descriptor type. */
type = TREE_TYPE (tmpdesc); type = TREE_TYPE (tmpdesc);
assert (GFC_ARRAY_TYPE_P (type)); gcc_assert (GFC_ARRAY_TYPE_P (type));
dumdesc = GFC_DECL_SAVED_DESCRIPTOR (tmpdesc); dumdesc = GFC_DECL_SAVED_DESCRIPTOR (tmpdesc);
dumdesc = gfc_build_indirect_ref (dumdesc); dumdesc = gfc_build_indirect_ref (dumdesc);
gfc_start_block (&block); gfc_start_block (&block);
...@@ -3272,7 +3271,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) ...@@ -3272,7 +3271,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
} }
else else
{ {
assert (integer_onep (GFC_TYPE_ARRAY_STRIDE (type, 0))); gcc_assert (integer_onep (GFC_TYPE_ARRAY_STRIDE (type, 0)));
/* A library call to repack the array if neccessary. */ /* A library call to repack the array if neccessary. */
tmp = GFC_DECL_SAVED_DESCRIPTOR (tmpdesc); tmp = GFC_DECL_SAVED_DESCRIPTOR (tmpdesc);
tmp = gfc_chainon_list (NULL_TREE, tmp); tmp = gfc_chainon_list (NULL_TREE, tmp);
...@@ -3488,7 +3487,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -3488,7 +3487,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
int full; int full;
gfc_ss *vss; gfc_ss *vss;
assert (ss != gfc_ss_terminator); gcc_assert (ss != gfc_ss_terminator);
/* TODO: Pass constant array constructors without a temporary. */ /* TODO: Pass constant array constructors without a temporary. */
/* Special case things we know we can pass easily. */ /* Special case things we know we can pass easily. */
...@@ -3503,7 +3502,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -3503,7 +3502,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
while (secss != gfc_ss_terminator && secss->type != GFC_SS_SECTION) while (secss != gfc_ss_terminator && secss->type != GFC_SS_SECTION)
secss = secss->next; secss = secss->next;
assert (secss != gfc_ss_terminator); gcc_assert (secss != gfc_ss_terminator);
need_tmp = 0; need_tmp = 0;
for (n = 0; n < secss->data.info.dimen; n++) for (n = 0; n < secss->data.info.dimen; n++)
...@@ -3529,7 +3528,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -3529,7 +3528,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
full = 0; full = 0;
else else
{ {
assert (info->ref->u.ar.type == AR_SECTION); gcc_assert (info->ref->u.ar.type == AR_SECTION);
full = 1; full = 1;
for (n = 0; n < info->ref->u.ar.dimen; n++) for (n = 0; n < info->ref->u.ar.dimen; n++)
...@@ -3582,7 +3581,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -3582,7 +3581,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
if (se->direct_byref) if (se->direct_byref)
{ {
assert (secss != gfc_ss_terminator); gcc_assert (secss != gfc_ss_terminator);
/* For pointer assignments pass the descriptor directly. */ /* For pointer assignments pass the descriptor directly. */
se->ss = secss; se->ss = secss;
...@@ -3623,7 +3622,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -3623,7 +3622,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
if (!need_tmp) if (!need_tmp)
loop.array_parameter = 1; loop.array_parameter = 1;
else else
assert (se->want_pointer && !se->direct_byref); gcc_assert (se->want_pointer && !se->direct_byref);
/* Setup the scalarizing loops and bounds. */ /* Setup the scalarizing loops and bounds. */
gfc_conv_ss_startstride (&loop); gfc_conv_ss_startstride (&loop);
...@@ -3685,7 +3684,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -3685,7 +3684,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
tmp = gfc_conv_descriptor_stride (desc, gfc_rank_cst[0]); tmp = gfc_conv_descriptor_stride (desc, gfc_rank_cst[0]);
gfc_add_modify_expr (&loop.pre, tmp, gfc_index_zero_node); gfc_add_modify_expr (&loop.pre, tmp, gfc_index_zero_node);
assert (is_gimple_lvalue (desc)); gcc_assert (is_gimple_lvalue (desc));
se->expr = gfc_build_addr_expr (NULL, desc); se->expr = gfc_build_addr_expr (NULL, desc);
} }
else if (expr->expr_type == EXPR_FUNCTION) else if (expr->expr_type == EXPR_FUNCTION)
...@@ -3720,7 +3719,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -3720,7 +3719,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
se->string_length = expr->symtree->n.sym->ts.cl->backend_decl; se->string_length = expr->symtree->n.sym->ts.cl->backend_decl;
desc = info->descriptor; desc = info->descriptor;
assert (secss && secss != gfc_ss_terminator); gcc_assert (secss && secss != gfc_ss_terminator);
if (se->direct_byref) if (se->direct_byref)
{ {
/* For pointer assignments we fill in the destination. */ /* For pointer assignments we fill in the destination. */
...@@ -3764,14 +3763,14 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -3764,14 +3763,14 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
/* Work out the offset. */ /* Work out the offset. */
if (info->ref->u.ar.dimen_type[n] == DIMEN_ELEMENT) if (info->ref->u.ar.dimen_type[n] == DIMEN_ELEMENT)
{ {
assert (info->subscript[n] gcc_assert (info->subscript[n]
&& info->subscript[n]->type == GFC_SS_SCALAR); && info->subscript[n]->type == GFC_SS_SCALAR);
start = info->subscript[n]->data.scalar.expr; start = info->subscript[n]->data.scalar.expr;
} }
else else
{ {
/* Check we haven't somehow got out of sync. */ /* Check we haven't somehow got out of sync. */
assert (info->dim[dim] == n); gcc_assert (info->dim[dim] == n);
/* Evaluate and remember the start of the section. */ /* Evaluate and remember the start of the section. */
start = info->start[dim]; start = info->start[dim];
...@@ -3791,7 +3790,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -3791,7 +3790,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
} }
/* Vector subscripts need copying and are handled elsewhere. */ /* Vector subscripts need copying and are handled elsewhere. */
assert (info->ref->u.ar.dimen_type[n] == DIMEN_RANGE); gcc_assert (info->ref->u.ar.dimen_type[n] == DIMEN_RANGE);
/* Set the new lower bound. */ /* Set the new lower bound. */
from = loop.from[dim]; from = loop.from[dim];
...@@ -3973,7 +3972,7 @@ gfc_trans_deferred_array (gfc_symbol * sym, tree body) ...@@ -3973,7 +3972,7 @@ gfc_trans_deferred_array (gfc_symbol * sym, tree body)
gfc_init_block (&fnblock); gfc_init_block (&fnblock);
assert (TREE_CODE (sym->backend_decl) == VAR_DECL); gcc_assert (TREE_CODE (sym->backend_decl) == VAR_DECL);
if (sym->ts.type == BT_CHARACTER if (sym->ts.type == BT_CHARACTER
&& !INTEGER_CST_P (sym->ts.cl->backend_decl)) && !INTEGER_CST_P (sym->ts.cl->backend_decl))
gfc_trans_init_string_length (sym->ts.cl, &fnblock); gfc_trans_init_string_length (sym->ts.cl, &fnblock);
...@@ -3999,7 +3998,7 @@ gfc_trans_deferred_array (gfc_symbol * sym, tree body) ...@@ -3999,7 +3998,7 @@ gfc_trans_deferred_array (gfc_symbol * sym, tree body)
/* Get the descriptor type. */ /* Get the descriptor type. */
type = TREE_TYPE (sym->backend_decl); type = TREE_TYPE (sym->backend_decl);
assert (GFC_DESCRIPTOR_TYPE_P (type)); gcc_assert (GFC_DESCRIPTOR_TYPE_P (type));
/* NULLIFY the data pointer. */ /* NULLIFY the data pointer. */
tmp = gfc_conv_descriptor_data (descriptor); tmp = gfc_conv_descriptor_data (descriptor);
...@@ -4083,9 +4082,9 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr) ...@@ -4083,9 +4082,9 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr)
newss->data.info.dim[n] = n; newss->data.info.dim[n] = n;
ar->dimen_type[n] = DIMEN_RANGE; ar->dimen_type[n] = DIMEN_RANGE;
assert (ar->start[n] == NULL); gcc_assert (ar->start[n] == NULL);
assert (ar->end[n] == NULL); gcc_assert (ar->end[n] == NULL);
assert (ar->stride[n] == NULL); gcc_assert (ar->stride[n] == NULL);
} }
return newss; return newss;
...@@ -4108,7 +4107,7 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr) ...@@ -4108,7 +4107,7 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr)
{ {
case DIMEN_ELEMENT: case DIMEN_ELEMENT:
/* Add SS for elemental (scalar) subscripts. */ /* Add SS for elemental (scalar) subscripts. */
assert (ar->start[n]); gcc_assert (ar->start[n]);
indexss = gfc_get_ss (); indexss = gfc_get_ss ();
indexss->type = GFC_SS_SCALAR; indexss->type = GFC_SS_SCALAR;
indexss->expr = ar->start[n]; indexss->expr = ar->start[n];
...@@ -4149,17 +4148,17 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr) ...@@ -4149,17 +4148,17 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr)
default: default:
/* We should know what sort of section it is by now. */ /* We should know what sort of section it is by now. */
abort (); gcc_unreachable ();
} }
} }
/* We should have at least one non-elemental dimension. */ /* We should have at least one non-elemental dimension. */
assert (newss->data.info.dimen > 0); gcc_assert (newss->data.info.dimen > 0);
return head; return head;
break; break;
default: default:
/* We should know what sort of section it is by now. */ /* We should know what sort of section it is by now. */
abort (); gcc_unreachable ();
} }
} }
...@@ -4203,14 +4202,14 @@ gfc_walk_op_expr (gfc_ss * ss, gfc_expr * expr) ...@@ -4203,14 +4202,14 @@ gfc_walk_op_expr (gfc_ss * ss, gfc_expr * expr)
while (head && head->next != ss) while (head && head->next != ss)
head = head->next; head = head->next;
/* Check we haven't somehow broken the chain. */ /* Check we haven't somehow broken the chain. */
assert (head); gcc_assert (head);
newss->next = ss; newss->next = ss;
head->next = newss; head->next = newss;
newss->expr = expr->op1; newss->expr = expr->op1;
} }
else /* head2 == head */ else /* head2 == head */
{ {
assert (head2 == head); gcc_assert (head2 == head);
/* Second operand is scalar. */ /* Second operand is scalar. */
newss->next = head2; newss->next = head2;
head2 = newss; head2 = newss;
...@@ -4229,13 +4228,14 @@ gfc_reverse_ss (gfc_ss * ss) ...@@ -4229,13 +4228,14 @@ gfc_reverse_ss (gfc_ss * ss)
gfc_ss *next; gfc_ss *next;
gfc_ss *head; gfc_ss *head;
assert (ss != NULL); gcc_assert (ss != NULL);
head = gfc_ss_terminator; head = gfc_ss_terminator;
while (ss != gfc_ss_terminator) while (ss != gfc_ss_terminator)
{ {
next = ss->next; next = ss->next;
assert (next != NULL); /* Check we didn't somehow break the chain. */ /* Check we didn't somehow break the chain. */
gcc_assert (next != NULL);
ss->next = head; ss->next = head;
head = ss; head = ss;
ss = next; ss = next;
......
...@@ -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;
......
...@@ -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 "errors.h" #include "errors.h"
#include "flags.h" #include "flags.h"
#include "cgraph.h" #include "cgraph.h"
#include <assert.h>
#include "gfortran.h" #include "gfortran.h"
#include "trans.h" #include "trans.h"
#include "trans-types.h" #include "trans-types.h"
...@@ -131,7 +130,7 @@ tree gfor_fndecl_sr_kind; ...@@ -131,7 +130,7 @@ tree gfor_fndecl_sr_kind;
static void static void
gfc_add_decl_to_parent_function (tree decl) gfc_add_decl_to_parent_function (tree decl)
{ {
assert (decl); gcc_assert (decl);
DECL_CONTEXT (decl) = DECL_CONTEXT (current_function_decl); DECL_CONTEXT (decl) = DECL_CONTEXT (current_function_decl);
DECL_NONLOCAL (decl) = 1; DECL_NONLOCAL (decl) = 1;
TREE_CHAIN (decl) = saved_parent_function_decls; TREE_CHAIN (decl) = saved_parent_function_decls;
...@@ -141,7 +140,7 @@ gfc_add_decl_to_parent_function (tree decl) ...@@ -141,7 +140,7 @@ gfc_add_decl_to_parent_function (tree decl)
void void
gfc_add_decl_to_function (tree decl) gfc_add_decl_to_function (tree decl)
{ {
assert (decl); gcc_assert (decl);
TREE_USED (decl) = 1; TREE_USED (decl) = 1;
DECL_CONTEXT (decl) = current_function_decl; DECL_CONTEXT (decl) = current_function_decl;
TREE_CHAIN (decl) = saved_function_decls; TREE_CHAIN (decl) = saved_function_decls;
...@@ -242,7 +241,7 @@ gfc_get_label_decl (gfc_st_label * lp) ...@@ -242,7 +241,7 @@ gfc_get_label_decl (gfc_st_label * lp)
tree label_decl; tree label_decl;
/* Validate the label declaration from the front end. */ /* Validate the label declaration from the front end. */
assert (lp != NULL && lp->value <= MAX_LABEL_VALUE); gcc_assert (lp != NULL && lp->value <= MAX_LABEL_VALUE);
/* Build a mangled name for the label. */ /* Build a mangled name for the label. */
sprintf (label_name, "__label_%.6d", lp->value); sprintf (label_name, "__label_%.6d", lp->value);
...@@ -330,13 +329,13 @@ static void ...@@ -330,13 +329,13 @@ static void
gfc_finish_decl (tree decl, tree init) gfc_finish_decl (tree decl, tree init)
{ {
if (TREE_CODE (decl) == PARM_DECL) if (TREE_CODE (decl) == PARM_DECL)
assert (init == NULL_TREE); gcc_assert (init == NULL_TREE);
/* Remember that PARM_DECL doesn't have a DECL_INITIAL field per se /* Remember that PARM_DECL doesn't have a DECL_INITIAL field per se
-- it overlaps DECL_ARG_TYPE. */ -- it overlaps DECL_ARG_TYPE. */
else if (init == NULL_TREE) else if (init == NULL_TREE)
assert (DECL_INITIAL (decl) == NULL_TREE); gcc_assert (DECL_INITIAL (decl) == NULL_TREE);
else else
assert (DECL_INITIAL (decl) == error_mark_node); gcc_assert (DECL_INITIAL (decl) == error_mark_node);
if (init != NULL_TREE) if (init != NULL_TREE)
{ {
...@@ -414,7 +413,7 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym) ...@@ -414,7 +413,7 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
else if (sym->module[0] && !sym->attr.result) else if (sym->module[0] && !sym->attr.result)
{ {
/* TODO: Don't set sym->module for result variables. */ /* TODO: Don't set sym->module for result variables. */
assert (current_function_decl == NULL_TREE); gcc_assert (current_function_decl == NULL_TREE);
/* This is the declaration of a module variable. */ /* This is the declaration of a module variable. */
TREE_PUBLIC (decl) = 1; TREE_PUBLIC (decl) = 1;
TREE_STATIC (decl) = 1; TREE_STATIC (decl) = 1;
...@@ -510,7 +509,7 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym) ...@@ -510,7 +509,7 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym)
if (GFC_DESCRIPTOR_TYPE_P (type)) if (GFC_DESCRIPTOR_TYPE_P (type))
return; return;
assert (GFC_ARRAY_TYPE_P (type)); gcc_assert (GFC_ARRAY_TYPE_P (type));
nest = (sym->ns->proc_name->backend_decl != current_function_decl) nest = (sym->ns->proc_name->backend_decl != current_function_decl)
&& !sym->attr.contained; && !sym->attr.contained;
...@@ -562,7 +561,7 @@ gfc_build_dummy_array_decl (gfc_symbol * sym, tree dummy) ...@@ -562,7 +561,7 @@ gfc_build_dummy_array_decl (gfc_symbol * sym, tree dummy)
gfc_defer_symbol_init (sym); gfc_defer_symbol_init (sym);
type = TREE_TYPE (dummy); type = TREE_TYPE (dummy);
assert (TREE_CODE (dummy) == PARM_DECL gcc_assert (TREE_CODE (dummy) == PARM_DECL
&& POINTER_TYPE_P (type)); && POINTER_TYPE_P (type));
/* Do we know the element size? */ /* Do we know the element size? */
...@@ -573,7 +572,7 @@ gfc_build_dummy_array_decl (gfc_symbol * sym, tree dummy) ...@@ -573,7 +572,7 @@ gfc_build_dummy_array_decl (gfc_symbol * sym, tree dummy)
{ {
/* For descriptorless arrays with known element size the actual /* For descriptorless arrays with known element size the actual
argument is sufficient. */ argument is sufficient. */
assert (GFC_ARRAY_TYPE_P (type)); gcc_assert (GFC_ARRAY_TYPE_P (type));
gfc_build_qualified_array (dummy, sym); gfc_build_qualified_array (dummy, sym);
return dummy; return dummy;
} }
...@@ -630,7 +629,7 @@ gfc_build_dummy_array_decl (gfc_symbol * sym, tree dummy) ...@@ -630,7 +629,7 @@ gfc_build_dummy_array_decl (gfc_symbol * sym, tree dummy)
/* We should never get deferred shape arrays here. We used to because of /* We should never get deferred shape arrays here. We used to because of
frontend bugs. */ frontend bugs. */
assert (sym->as->type != AS_DEFERRED); gcc_assert (sym->as->type != AS_DEFERRED);
switch (packed) switch (packed)
{ {
...@@ -670,7 +669,7 @@ gfc_create_string_length (gfc_symbol * sym) ...@@ -670,7 +669,7 @@ gfc_create_string_length (gfc_symbol * sym)
{ {
tree length; tree length;
assert (sym->ts.cl); gcc_assert (sym->ts.cl);
gfc_conv_const_charlen (sym->ts.cl); gfc_conv_const_charlen (sym->ts.cl);
if (sym->ts.cl->backend_decl == NULL_TREE) if (sym->ts.cl->backend_decl == NULL_TREE)
...@@ -702,7 +701,7 @@ gfc_get_symbol_decl (gfc_symbol * sym) ...@@ -702,7 +701,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
tree length = NULL_TREE; tree length = NULL_TREE;
int byref; int byref;
assert (sym->attr.referenced); gcc_assert (sym->attr.referenced);
if (sym->ns && sym->ns->proc_name->attr.function) if (sym->ns && sym->ns->proc_name->attr.function)
byref = gfc_return_by_reference (sym->ns->proc_name); byref = gfc_return_by_reference (sym->ns->proc_name);
...@@ -720,7 +719,7 @@ gfc_get_symbol_decl (gfc_symbol * sym) ...@@ -720,7 +719,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
} }
/* Dummy variables should already have been created. */ /* Dummy variables should already have been created. */
assert (sym->backend_decl); gcc_assert (sym->backend_decl);
/* Create a character length variable. */ /* Create a character length variable. */
if (sym->ts.type == BT_CHARACTER) if (sym->ts.type == BT_CHARACTER)
...@@ -825,7 +824,7 @@ gfc_get_symbol_decl (gfc_symbol * sym) ...@@ -825,7 +824,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
SET_DECL_ASSEMBLER_NAME (decl, get_identifier (name)); SET_DECL_ASSEMBLER_NAME (decl, get_identifier (name));
} }
gfc_finish_var_decl (length, sym); gfc_finish_var_decl (length, sym);
assert (!sym->value); gcc_assert (!sym->value);
} }
} }
sym->backend_decl = decl; sym->backend_decl = decl;
...@@ -888,7 +887,7 @@ gfc_get_extern_function_decl (gfc_symbol * sym) ...@@ -888,7 +887,7 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
/* We should never be creating external decls for alternate entry points. /* We should never be creating external decls for alternate entry points.
The procedure may be an alternate entry point, but we don't want/need The procedure may be an alternate entry point, but we don't want/need
to know that. */ to know that. */
assert (!(sym->attr.entry || sym->attr.entry_master)); gcc_assert (!(sym->attr.entry || sym->attr.entry_master));
if (sym->attr.intrinsic) if (sym->attr.intrinsic)
{ {
...@@ -897,13 +896,13 @@ gfc_get_extern_function_decl (gfc_symbol * sym) ...@@ -897,13 +896,13 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
at the first argument. We pass NULL for the second argument at the first argument. We pass NULL for the second argument
otherwise things like AINT get confused. */ otherwise things like AINT get confused. */
isym = gfc_find_function (sym->name); isym = gfc_find_function (sym->name);
assert (isym->resolve.f0 != NULL); gcc_assert (isym->resolve.f0 != NULL);
memset (&e, 0, sizeof (e)); memset (&e, 0, sizeof (e));
e.expr_type = EXPR_FUNCTION; e.expr_type = EXPR_FUNCTION;
memset (&argexpr, 0, sizeof (argexpr)); memset (&argexpr, 0, sizeof (argexpr));
assert (isym->formal); gcc_assert (isym->formal);
argexpr.ts = isym->formal->ts; argexpr.ts = isym->formal->ts;
if (isym->formal->next == NULL) if (isym->formal->next == NULL)
...@@ -911,7 +910,7 @@ gfc_get_extern_function_decl (gfc_symbol * sym) ...@@ -911,7 +910,7 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
else else
{ {
/* All specific intrinsics take one or two arguments. */ /* All specific intrinsics take one or two arguments. */
assert (isym->formal->next->next == NULL); gcc_assert (isym->formal->next->next == NULL);
isym->resolve.f2 (&e, &argexpr, NULL); isym->resolve.f2 (&e, &argexpr, NULL);
} }
sprintf (s, "specific%s", e.value.function.name); sprintf (s, "specific%s", e.value.function.name);
...@@ -988,15 +987,15 @@ build_function_decl (gfc_symbol * sym) ...@@ -988,15 +987,15 @@ build_function_decl (gfc_symbol * sym)
tree result_decl; tree result_decl;
gfc_formal_arglist *f; gfc_formal_arglist *f;
assert (!sym->backend_decl); gcc_assert (!sym->backend_decl);
assert (!sym->attr.external); gcc_assert (!sym->attr.external);
/* Set the line and filename. sym->declared_at seems to point to the /* Set the line and filename. sym->declared_at seems to point to the
last statement for subroutines, but it'll do for now. */ last statement for subroutines, but it'll do for now. */
gfc_set_backend_locus (&sym->declared_at); gfc_set_backend_locus (&sym->declared_at);
/* Allow only one nesting level. Allow public declarations. */ /* Allow only one nesting level. Allow public declarations. */
assert (current_function_decl == NULL_TREE gcc_assert (current_function_decl == NULL_TREE
|| DECL_CONTEXT (current_function_decl) == NULL_TREE); || DECL_CONTEXT (current_function_decl) == NULL_TREE);
type = gfc_get_function_type (sym); type = gfc_get_function_type (sym);
...@@ -1147,7 +1146,7 @@ create_function_arglist (gfc_symbol * sym) ...@@ -1147,7 +1146,7 @@ create_function_arglist (gfc_symbol * sym)
/* Length of character result. */ /* Length of character result. */
type = TREE_VALUE (typelist); type = TREE_VALUE (typelist);
assert (type == gfc_charlen_type_node); gcc_assert (type == gfc_charlen_type_node);
length = build_decl (PARM_DECL, length = build_decl (PARM_DECL,
get_identifier (".__result"), get_identifier (".__result"),
...@@ -1157,7 +1156,7 @@ create_function_arglist (gfc_symbol * sym) ...@@ -1157,7 +1156,7 @@ create_function_arglist (gfc_symbol * sym)
sym->ts.cl->backend_decl = length; sym->ts.cl->backend_decl = length;
TREE_USED (length) = 1; TREE_USED (length) = 1;
} }
assert (TREE_CODE (length) == PARM_DECL); gcc_assert (TREE_CODE (length) == PARM_DECL);
arglist = chainon (arglist, length); arglist = chainon (arglist, length);
typelist = TREE_CHAIN (typelist); typelist = TREE_CHAIN (typelist);
DECL_CONTEXT (length) = fndecl; DECL_CONTEXT (length) = fndecl;
...@@ -1209,7 +1208,7 @@ create_function_arglist (gfc_symbol * sym) ...@@ -1209,7 +1208,7 @@ create_function_arglist (gfc_symbol * sym)
parm = f->sym->backend_decl; parm = f->sym->backend_decl;
type = TREE_VALUE (typelist); type = TREE_VALUE (typelist);
assert (type == gfc_charlen_type_node); gcc_assert (type == gfc_charlen_type_node);
strcpy (&name[1], f->sym->name); strcpy (&name[1], f->sym->name);
name[0] = '_'; name[0] = '_';
...@@ -1252,7 +1251,7 @@ create_function_arglist (gfc_symbol * sym) ...@@ -1252,7 +1251,7 @@ create_function_arglist (gfc_symbol * sym)
typelist = TREE_CHAIN (typelist); typelist = TREE_CHAIN (typelist);
} }
assert (TREE_VALUE (typelist) == void_type_node); gcc_assert (TREE_VALUE (typelist) == void_type_node);
DECL_ARGUMENTS (fndecl) = arglist; DECL_ARGUMENTS (fndecl) = arglist;
} }
...@@ -1344,7 +1343,7 @@ build_entry_thunks (gfc_namespace * ns) ...@@ -1344,7 +1343,7 @@ build_entry_thunks (gfc_namespace * ns)
locus old_loc; locus old_loc;
/* This should always be a toplevel function. */ /* This should always be a toplevel function. */
assert (current_function_decl == NULL_TREE); gcc_assert (current_function_decl == NULL_TREE);
gfc_get_backend_locus (&old_loc); gfc_get_backend_locus (&old_loc);
for (el = ns->entries; el; el = el->next) for (el = ns->entries; el; el = el->next)
...@@ -1538,7 +1537,7 @@ gfc_build_library_function_decl (tree name, tree rettype, int nargs, ...) ...@@ -1538,7 +1537,7 @@ gfc_build_library_function_decl (tree name, tree rettype, int nargs, ...)
int n; int n;
/* Library functions must be declared with global scope. */ /* Library functions must be declared with global scope. */
assert (current_function_decl == NULL_TREE); gcc_assert (current_function_decl == NULL_TREE);
va_start (p, nargs); va_start (p, nargs);
...@@ -1873,8 +1872,8 @@ gfc_trans_auto_character_variable (gfc_symbol * sym, tree fnbody) ...@@ -1873,8 +1872,8 @@ gfc_trans_auto_character_variable (gfc_symbol * sym, tree fnbody)
tree decl; tree decl;
tree tmp; tree tmp;
assert (sym->backend_decl); gcc_assert (sym->backend_decl);
assert (sym->ts.cl && sym->ts.cl->length); gcc_assert (sym->ts.cl && sym->ts.cl->length);
gfc_start_block (&body); gfc_start_block (&body);
...@@ -1959,7 +1958,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody) ...@@ -1959,7 +1958,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
case AS_ASSUMED_SIZE: case AS_ASSUMED_SIZE:
/* Must be a dummy parameter. */ /* Must be a dummy parameter. */
assert (sym->attr.dummy); gcc_assert (sym->attr.dummy);
/* We should always pass assumed size arrays the g77 way. */ /* We should always pass assumed size arrays the g77 way. */
fnbody = gfc_trans_g77_array (sym, fnbody); fnbody = gfc_trans_g77_array (sym, fnbody);
...@@ -1967,7 +1966,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody) ...@@ -1967,7 +1966,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
case AS_ASSUMED_SHAPE: case AS_ASSUMED_SHAPE:
/* Must be a dummy parameter. */ /* Must be a dummy parameter. */
assert (sym->attr.dummy); gcc_assert (sym->attr.dummy);
fnbody = gfc_trans_dummy_array_bias (sym, sym->backend_decl, fnbody = gfc_trans_dummy_array_bias (sym, sym->backend_decl,
fnbody); fnbody);
...@@ -1978,7 +1977,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody) ...@@ -1978,7 +1977,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
else if (sym->ts.type == BT_CHARACTER) else if (sym->ts.type == BT_CHARACTER)
...@@ -1992,7 +1991,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody) ...@@ -1992,7 +1991,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
gfc_set_backend_locus (&loc); gfc_set_backend_locus (&loc);
} }
else else
abort (); gcc_unreachable ();
} }
return fnbody; return fnbody;
...@@ -2059,7 +2058,7 @@ gfc_generate_module_vars (gfc_namespace * ns) ...@@ -2059,7 +2058,7 @@ gfc_generate_module_vars (gfc_namespace * ns)
module_namespace = ns; module_namespace = ns;
/* Check if the frontend left the namespace in a reasonable state. */ /* Check if the frontend left the namespace in a reasonable state. */
assert (ns->proc_name && !ns->proc_name->tlink); gcc_assert (ns->proc_name && !ns->proc_name->tlink);
/* Generate COMMON blocks. */ /* Generate COMMON blocks. */
gfc_trans_common (ns); gfc_trans_common (ns);
...@@ -2181,7 +2180,7 @@ gfc_generate_function_code (gfc_namespace * ns) ...@@ -2181,7 +2180,7 @@ gfc_generate_function_code (gfc_namespace * ns)
sym = ns->proc_name; sym = ns->proc_name;
/* Check that the frontend isn't still using this. */ /* Check that the frontend isn't still using this. */
assert (sym->tlink == NULL); gcc_assert (sym->tlink == NULL);
sym->tlink = sym; sym->tlink = sym;
/* Create the declaration for functions with global scope. */ /* Create the declaration for functions with global scope. */
...@@ -2322,8 +2321,7 @@ gfc_generate_function_code (gfc_namespace * ns) ...@@ -2322,8 +2321,7 @@ gfc_generate_function_code (gfc_namespace * ns)
void void
gfc_generate_constructors (void) gfc_generate_constructors (void)
{ {
if (gfc_static_ctors != NULL_TREE) gcc_assert (gfc_static_ctors == NULL_TREE);
abort ();
#if 0 #if 0
tree fnname; tree fnname;
tree type; tree type;
......
...@@ -34,7 +34,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -34,7 +34,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tree-gimple.h" #include "tree-gimple.h"
#include "flags.h" #include "flags.h"
#include <gmp.h> #include <gmp.h>
#include <assert.h>
#include "gfortran.h" #include "gfortran.h"
#include "trans.h" #include "trans.h"
#include "trans-const.h" #include "trans-const.h"
...@@ -84,14 +83,14 @@ gfc_advance_se_ss_chain (gfc_se * se) ...@@ -84,14 +83,14 @@ gfc_advance_se_ss_chain (gfc_se * se)
{ {
gfc_se *p; gfc_se *p;
assert (se != NULL && se->ss != NULL && se->ss != gfc_ss_terminator); gcc_assert (se != NULL && se->ss != NULL && se->ss != gfc_ss_terminator);
p = se; p = se;
/* Walk down the parent chain. */ /* Walk down the parent chain. */
while (p != NULL) while (p != NULL)
{ {
/* Simple consistency check. */ /* Simple consistency check. */
assert (p->parent == NULL || p->parent->ss == p->ss); gcc_assert (p->parent == NULL || p->parent->ss == p->ss);
p->ss = p->ss->next; p->ss = p->ss->next;
...@@ -125,14 +124,14 @@ gfc_conv_expr_present (gfc_symbol * sym) ...@@ -125,14 +124,14 @@ gfc_conv_expr_present (gfc_symbol * sym)
{ {
tree decl; tree decl;
assert (sym->attr.dummy && sym->attr.optional); gcc_assert (sym->attr.dummy && sym->attr.optional);
decl = gfc_get_symbol_decl (sym); decl = gfc_get_symbol_decl (sym);
if (TREE_CODE (decl) != PARM_DECL) if (TREE_CODE (decl) != PARM_DECL)
{ {
/* Array parameters use a temporary descriptor, we want the real /* Array parameters use a temporary descriptor, we want the real
parameter. */ parameter. */
assert (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl)) gcc_assert (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))
|| GFC_ARRAY_TYPE_P (TREE_TYPE (decl))); || GFC_ARRAY_TYPE_P (TREE_TYPE (decl)));
decl = GFC_DECL_SAVED_DESCRIPTOR (decl); decl = GFC_DECL_SAVED_DESCRIPTOR (decl);
} }
...@@ -219,10 +218,10 @@ gfc_conv_component_ref (gfc_se * se, gfc_ref * ref) ...@@ -219,10 +218,10 @@ gfc_conv_component_ref (gfc_se * se, gfc_ref * ref)
c = ref->u.c.component; c = ref->u.c.component;
assert (c->backend_decl); gcc_assert (c->backend_decl);
field = c->backend_decl; field = c->backend_decl;
assert (TREE_CODE (field) == FIELD_DECL); gcc_assert (TREE_CODE (field) == FIELD_DECL);
decl = se->expr; decl = se->expr;
tmp = build3 (COMPONENT_REF, TREE_TYPE (field), decl, field, NULL_TREE); tmp = build3 (COMPONENT_REF, TREE_TYPE (field), decl, field, NULL_TREE);
...@@ -232,7 +231,7 @@ gfc_conv_component_ref (gfc_se * se, gfc_ref * ref) ...@@ -232,7 +231,7 @@ gfc_conv_component_ref (gfc_se * se, gfc_ref * ref)
{ {
tmp = c->ts.cl->backend_decl; tmp = c->ts.cl->backend_decl;
/* Components must always be constant length. */ /* Components must always be constant length. */
assert (tmp && INTEGER_CST_P (tmp)); gcc_assert (tmp && INTEGER_CST_P (tmp));
se->string_length = tmp; se->string_length = tmp;
} }
...@@ -254,8 +253,8 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr) ...@@ -254,8 +253,8 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
if (se->ss != NULL) if (se->ss != NULL)
{ {
/* Check that something hasn't gone horribly wrong. */ /* Check that something hasn't gone horribly wrong. */
assert (se->ss != gfc_ss_terminator); gcc_assert (se->ss != gfc_ss_terminator);
assert (se->ss->expr == expr); gcc_assert (se->ss->expr == expr);
/* A scalarized term. We already know the descriptor. */ /* A scalarized term. We already know the descriptor. */
se->expr = se->ss->data.info.descriptor; se->expr = se->ss->data.info.descriptor;
...@@ -270,10 +269,10 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr) ...@@ -270,10 +269,10 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
if (sym->attr.flavor == FL_PROCEDURE if (sym->attr.flavor == FL_PROCEDURE
&& se->expr != current_function_decl) && se->expr != current_function_decl)
{ {
assert (se->want_pointer); gcc_assert (se->want_pointer);
if (!sym->attr.dummy) if (!sym->attr.dummy)
{ {
assert (TREE_CODE (se->expr) == FUNCTION_DECL); gcc_assert (TREE_CODE (se->expr) == FUNCTION_DECL);
se->expr = gfc_build_addr_expr (NULL, se->expr); se->expr = gfc_build_addr_expr (NULL, se->expr);
} }
return; return;
...@@ -309,7 +308,7 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr) ...@@ -309,7 +308,7 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
if (sym->ts.type == BT_CHARACTER) if (sym->ts.type == BT_CHARACTER)
{ {
se->string_length = sym->ts.cl->backend_decl; se->string_length = sym->ts.cl->backend_decl;
assert (se->string_length); gcc_assert (se->string_length);
} }
while (ref) while (ref)
...@@ -340,7 +339,7 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr) ...@@ -340,7 +339,7 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
break; break;
default: default:
abort (); gcc_unreachable ();
break; break;
} }
ref = ref->next; ref = ref->next;
...@@ -367,7 +366,7 @@ gfc_conv_unary_op (enum tree_code code, gfc_se * se, gfc_expr * expr) ...@@ -367,7 +366,7 @@ gfc_conv_unary_op (enum tree_code code, gfc_se * se, gfc_expr * expr)
gfc_se operand; gfc_se operand;
tree type; tree type;
assert (expr->ts.type != BT_CHARACTER); gcc_assert (expr->ts.type != BT_CHARACTER);
/* Initialize the operand. */ /* Initialize the operand. */
gfc_init_se (&operand, se); gfc_init_se (&operand, se);
gfc_conv_expr_val (&operand, expr->op1); gfc_conv_expr_val (&operand, expr->op1);
...@@ -597,7 +596,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr) ...@@ -597,7 +596,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
break; break;
default: default:
abort(); gcc_unreachable ();
} }
switch (kind) switch (kind)
{ {
...@@ -606,7 +605,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr) ...@@ -606,7 +605,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
if (expr->op1->ts.type == BT_INTEGER) if (expr->op1->ts.type == BT_INTEGER)
lse.expr = convert (gfc_int4_type_node, lse.expr); lse.expr = convert (gfc_int4_type_node, lse.expr);
else else
abort (); gcc_unreachable ();
/* Fall through. */ /* Fall through. */
case 4: case 4:
...@@ -618,7 +617,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr) ...@@ -618,7 +617,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
break; break;
default: default:
abort(); gcc_unreachable ();
} }
switch (expr->op1->ts.type) switch (expr->op1->ts.type)
...@@ -636,7 +635,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr) ...@@ -636,7 +635,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
break; break;
...@@ -650,7 +649,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr) ...@@ -650,7 +649,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
fndecl = built_in_decls[BUILT_IN_POW]; fndecl = built_in_decls[BUILT_IN_POW];
break; break;
default: default:
abort (); gcc_unreachable ();
} }
break; break;
...@@ -664,12 +663,12 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr) ...@@ -664,12 +663,12 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
fndecl = gfor_fndecl_math_cpow; fndecl = gfor_fndecl_math_cpow;
break; break;
default: default:
abort (); gcc_unreachable ();
} }
break; break;
default: default:
abort (); gcc_unreachable ();
break; break;
} }
...@@ -688,8 +687,7 @@ gfc_conv_string_tmp (gfc_se * se, tree type, tree len) ...@@ -688,8 +687,7 @@ gfc_conv_string_tmp (gfc_se * se, tree type, tree len)
tree tmp; tree tmp;
tree args; tree args;
if (TREE_TYPE (len) != gfc_charlen_type_node) gcc_assert (TREE_TYPE (len) == gfc_charlen_type_node);
abort ();
if (gfc_can_put_var_on_stack (len)) if (gfc_can_put_var_on_stack (len))
{ {
...@@ -736,7 +734,7 @@ gfc_conv_concat_op (gfc_se * se, gfc_expr * expr) ...@@ -736,7 +734,7 @@ gfc_conv_concat_op (gfc_se * se, gfc_expr * expr)
tree args; tree args;
tree tmp; tree tmp;
assert (expr->op1->ts.type == BT_CHARACTER gcc_assert (expr->op1->ts.type == BT_CHARACTER
&& expr->op2->ts.type == BT_CHARACTER); && expr->op2->ts.type == BT_CHARACTER);
gfc_init_se (&lse, se); gfc_init_se (&lse, se);
...@@ -899,8 +897,7 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr) ...@@ -899,8 +897,7 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr)
case INTRINSIC_USER: case INTRINSIC_USER:
case INTRINSIC_ASSIGN: case INTRINSIC_ASSIGN:
/* These should be converted into function calls by the frontend. */ /* These should be converted into function calls by the frontend. */
abort (); gcc_unreachable ();
return;
default: default:
fatal_error ("Unknown intrinsic op"); fatal_error ("Unknown intrinsic op");
...@@ -908,7 +905,7 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr) ...@@ -908,7 +905,7 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr)
} }
/* The only exception to this is **, which is handled separately anyway. */ /* The only exception to this is **, which is handled separately anyway. */
assert (expr->op1->ts.type == expr->op2->ts.type); gcc_assert (expr->op1->ts.type == expr->op2->ts.type);
if (checkstring && expr->op1->ts.type != BT_CHARACTER) if (checkstring && expr->op1->ts.type != BT_CHARACTER)
checkstring = 0; checkstring = 0;
...@@ -967,7 +964,7 @@ gfc_conv_function_val (gfc_se * se, gfc_symbol * sym) ...@@ -967,7 +964,7 @@ gfc_conv_function_val (gfc_se * se, gfc_symbol * sym)
if (sym->attr.dummy) if (sym->attr.dummy)
{ {
tmp = gfc_get_symbol_decl (sym); tmp = gfc_get_symbol_decl (sym);
assert (TREE_CODE (TREE_TYPE (tmp)) == POINTER_TYPE gcc_assert (TREE_CODE (TREE_TYPE (tmp)) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (TREE_TYPE (tmp))) == FUNCTION_TYPE); && TREE_CODE (TREE_TYPE (TREE_TYPE (tmp))) == FUNCTION_TYPE);
se->expr = tmp; se->expr = tmp;
...@@ -978,7 +975,7 @@ gfc_conv_function_val (gfc_se * se, gfc_symbol * sym) ...@@ -978,7 +975,7 @@ gfc_conv_function_val (gfc_se * se, gfc_symbol * sym)
sym->backend_decl = gfc_get_extern_function_decl (sym); sym->backend_decl = gfc_get_extern_function_decl (sym);
tmp = sym->backend_decl; tmp = sym->backend_decl;
assert (TREE_CODE (tmp) == FUNCTION_DECL); gcc_assert (TREE_CODE (tmp) == FUNCTION_DECL);
se->expr = gfc_build_addr_expr (NULL, tmp); se->expr = gfc_build_addr_expr (NULL, tmp);
} }
} }
...@@ -1013,12 +1010,12 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, ...@@ -1013,12 +1010,12 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
{ {
if (!sym->attr.elemental) if (!sym->attr.elemental)
{ {
assert (se->ss->type == GFC_SS_FUNCTION); gcc_assert (se->ss->type == GFC_SS_FUNCTION);
if (se->ss->useflags) if (se->ss->useflags)
{ {
assert (gfc_return_by_reference (sym) gcc_assert (gfc_return_by_reference (sym)
&& sym->result->attr.dimension); && sym->result->attr.dimension);
assert (se->loop != NULL); gcc_assert (se->loop != NULL);
/* Access the previously obtained result. */ /* Access the previously obtained result. */
gfc_conv_tmp_array_ref (se); gfc_conv_tmp_array_ref (se);
...@@ -1038,7 +1035,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, ...@@ -1038,7 +1035,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
arglist = gfc_chainon_list (arglist, se->expr); arglist = gfc_chainon_list (arglist, se->expr);
else if (sym->result->attr.dimension) else if (sym->result->attr.dimension)
{ {
assert (se->loop && se->ss); gcc_assert (se->loop && se->ss);
/* Set the type of the array. */ /* Set the type of the array. */
tmp = gfc_typenode_for_spec (&sym->ts); tmp = gfc_typenode_for_spec (&sym->ts);
info->dimen = se->loop->dimen; info->dimen = se->loop->dimen;
...@@ -1057,7 +1054,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, ...@@ -1057,7 +1054,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
} }
else if (sym->ts.type == BT_CHARACTER) else if (sym->ts.type == BT_CHARACTER)
{ {
assert (sym->ts.cl && sym->ts.cl->length gcc_assert (sym->ts.cl && sym->ts.cl->length
&& sym->ts.cl->length->expr_type == EXPR_CONSTANT); && sym->ts.cl->length->expr_type == EXPR_CONSTANT);
len = gfc_conv_mpz_to_tree len = gfc_conv_mpz_to_tree
(sym->ts.cl->length->value.integer, sym->ts.cl->length->ts.kind); (sym->ts.cl->length->value.integer, sym->ts.cl->length->ts.kind);
...@@ -1071,7 +1068,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, ...@@ -1071,7 +1068,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
convert (gfc_charlen_type_node, len)); convert (gfc_charlen_type_node, len));
} }
else /* TODO: derived type function return values. */ else /* TODO: derived type function return values. */
abort (); gcc_unreachable ();
} }
formal = sym->formal; formal = sym->formal;
...@@ -1214,7 +1211,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, ...@@ -1214,7 +1211,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
se->string_length = len; se->string_length = len;
} }
else else
abort (); gcc_unreachable ();
} }
} }
} }
...@@ -1273,7 +1270,7 @@ gfc_conv_statement_function (gfc_se * se, gfc_expr * expr) ...@@ -1273,7 +1270,7 @@ gfc_conv_statement_function (gfc_se * se, gfc_expr * expr)
{ {
/* Each dummy shall be specified, explicitly or implicitly, to be /* Each dummy shall be specified, explicitly or implicitly, to be
scalar. */ scalar. */
assert (fargs->sym->attr.dimension == 0); gcc_assert (fargs->sym->attr.dimension == 0);
fsym = fargs->sym; fsym = fargs->sym;
/* Create a temporary to hold the value. */ /* Create a temporary to hold the value. */
...@@ -1285,7 +1282,7 @@ gfc_conv_statement_function (gfc_se * se, gfc_expr * expr) ...@@ -1285,7 +1282,7 @@ gfc_conv_statement_function (gfc_se * se, gfc_expr * expr)
/* Copy string arguments. */ /* Copy string arguments. */
tree arglen; tree arglen;
assert (fsym->ts.cl && fsym->ts.cl->length gcc_assert (fsym->ts.cl && fsym->ts.cl->length
&& fsym->ts.cl->length->expr_type == EXPR_CONSTANT); && fsym->ts.cl->length->expr_type == EXPR_CONSTANT);
arglen = TYPE_MAX_VALUE (TYPE_DOMAIN (type)); arglen = TYPE_MAX_VALUE (TYPE_DOMAIN (type));
...@@ -1380,8 +1377,8 @@ gfc_conv_function_expr (gfc_se * se, gfc_expr * expr) ...@@ -1380,8 +1377,8 @@ gfc_conv_function_expr (gfc_se * se, gfc_expr * expr)
static void static void
gfc_conv_array_constructor_expr (gfc_se * se, gfc_expr * expr) gfc_conv_array_constructor_expr (gfc_se * se, gfc_expr * expr)
{ {
assert (se->ss != NULL && se->ss != gfc_ss_terminator); gcc_assert (se->ss != NULL && se->ss != gfc_ss_terminator);
assert (se->ss->expr == expr && se->ss->type == GFC_SS_CONSTRUCTOR); gcc_assert (se->ss->expr == expr && se->ss->type == GFC_SS_CONSTRUCTOR);
gfc_conv_tmp_array_ref (se); gfc_conv_tmp_array_ref (se);
gfc_advance_se_ss_chain (se); gfc_advance_se_ss_chain (se);
...@@ -1513,8 +1510,7 @@ gfc_trans_subarray_assign (tree dest, gfc_component * cm, gfc_expr * expr) ...@@ -1513,8 +1510,7 @@ gfc_trans_subarray_assign (tree dest, gfc_component * cm, gfc_expr * expr)
tmp = gfc_trans_scalar_assign (&lse, &rse, cm->ts.type); tmp = gfc_trans_scalar_assign (&lse, &rse, cm->ts.type);
gfc_add_expr_to_block (&body, tmp); gfc_add_expr_to_block (&body, tmp);
if (rse.ss != gfc_ss_terminator) gcc_assert (rse.ss == gfc_ss_terminator);
abort ();
/* Generate the copying loops. */ /* Generate the copying loops. */
gfc_trans_scalarizing_loops (&loop, &body); gfc_trans_scalarizing_loops (&loop, &body);
...@@ -1648,8 +1644,8 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init) ...@@ -1648,8 +1644,8 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init)
tree type; tree type;
tree tmp; tree tmp;
assert (se->ss == NULL); gcc_assert (se->ss == NULL);
assert (expr->expr_type == EXPR_STRUCTURE); gcc_assert (expr->expr_type == EXPR_STRUCTURE);
type = gfc_typenode_for_spec (&expr->ts); type = gfc_typenode_for_spec (&expr->ts);
if (!init) if (!init)
...@@ -1699,7 +1695,7 @@ gfc_conv_substring_expr (gfc_se * se, gfc_expr * expr) ...@@ -1699,7 +1695,7 @@ gfc_conv_substring_expr (gfc_se * se, gfc_expr * expr)
ref = expr->ref; ref = expr->ref;
assert(ref->type == REF_SUBSTRING); gcc_assert (ref->type == REF_SUBSTRING);
se->expr = gfc_build_string_const(expr->value.character.length, se->expr = gfc_build_string_const(expr->value.character.length,
expr->value.character.string); expr->value.character.string);
...@@ -1761,7 +1757,7 @@ gfc_conv_expr (gfc_se * se, gfc_expr * expr) ...@@ -1761,7 +1757,7 @@ gfc_conv_expr (gfc_se * se, gfc_expr * expr)
break; break;
default: default:
abort (); gcc_unreachable ();
break; break;
} }
} }
...@@ -1772,7 +1768,7 @@ gfc_conv_expr_lhs (gfc_se * se, gfc_expr * expr) ...@@ -1772,7 +1768,7 @@ gfc_conv_expr_lhs (gfc_se * se, gfc_expr * expr)
gfc_conv_expr (se, expr); gfc_conv_expr (se, expr);
/* AFAICS all numeric lvalues have empty post chains. If not we need to /* AFAICS all numeric lvalues have empty post chains. If not we need to
figure out a way of rewriting an lvalue so that it has no post chain. */ figure out a way of rewriting an lvalue so that it has no post chain. */
assert (expr->ts.type != BT_CHARACTER || !se->post.head); gcc_assert (expr->ts.type != BT_CHARACTER || !se->post.head);
} }
void void
...@@ -1780,7 +1776,7 @@ gfc_conv_expr_val (gfc_se * se, gfc_expr * expr) ...@@ -1780,7 +1776,7 @@ gfc_conv_expr_val (gfc_se * se, gfc_expr * expr)
{ {
tree val; tree val;
assert (expr->ts.type != BT_CHARACTER); gcc_assert (expr->ts.type != BT_CHARACTER);
gfc_conv_expr (se, expr); gfc_conv_expr (se, expr);
if (se->post.head) if (se->post.head)
{ {
...@@ -1885,7 +1881,7 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gfc_expr * expr2) ...@@ -1885,7 +1881,7 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gfc_expr * expr2)
/* Scalar pointers. */ /* Scalar pointers. */
lse.want_pointer = 1; lse.want_pointer = 1;
gfc_conv_expr (&lse, expr1); gfc_conv_expr (&lse, expr1);
assert (rss == gfc_ss_terminator); gcc_assert (rss == gfc_ss_terminator);
gfc_init_se (&rse, NULL); gfc_init_se (&rse, NULL);
rse.want_pointer = 1; rse.want_pointer = 1;
gfc_conv_expr (&rse, expr2); gfc_conv_expr (&rse, expr2);
...@@ -1936,12 +1932,12 @@ gfc_conv_string_parameter (gfc_se * se) ...@@ -1936,12 +1932,12 @@ gfc_conv_string_parameter (gfc_se * se)
type = TREE_TYPE (se->expr); type = TREE_TYPE (se->expr);
if (TYPE_STRING_FLAG (type)) if (TYPE_STRING_FLAG (type))
{ {
assert (TREE_CODE (se->expr) != INDIRECT_REF); gcc_assert (TREE_CODE (se->expr) != INDIRECT_REF);
se->expr = gfc_build_addr_expr (pchar_type_node, se->expr); se->expr = gfc_build_addr_expr (pchar_type_node, se->expr);
} }
assert (POINTER_TYPE_P (TREE_TYPE (se->expr))); gcc_assert (POINTER_TYPE_P (TREE_TYPE (se->expr)));
assert (se->string_length gcc_assert (se->string_length
&& TREE_CODE (TREE_TYPE (se->string_length)) == INTEGER_TYPE); && TREE_CODE (TREE_TYPE (se->string_length)) == INTEGER_TYPE);
} }
...@@ -1958,7 +1954,7 @@ gfc_trans_scalar_assign (gfc_se * lse, gfc_se * rse, bt type) ...@@ -1958,7 +1954,7 @@ gfc_trans_scalar_assign (gfc_se * lse, gfc_se * rse, bt type)
if (type == BT_CHARACTER) if (type == BT_CHARACTER)
{ {
assert (lse->string_length != NULL_TREE gcc_assert (lse->string_length != NULL_TREE
&& rse->string_length != NULL_TREE); && rse->string_length != NULL_TREE);
gfc_conv_string_parameter (lse); gfc_conv_string_parameter (lse);
...@@ -2010,12 +2006,12 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2) ...@@ -2010,12 +2006,12 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2)
/* The frontend doesn't seem to bother filling in expr->symtree for intrinsic /* The frontend doesn't seem to bother filling in expr->symtree for intrinsic
functions. */ functions. */
assert (expr2->value.function.isym gcc_assert (expr2->value.function.isym
|| (gfc_return_by_reference (expr2->symtree->n.sym) || (gfc_return_by_reference (expr2->symtree->n.sym)
&& expr2->symtree->n.sym->result->attr.dimension)); && expr2->symtree->n.sym->result->attr.dimension));
ss = gfc_walk_expr (expr1); ss = gfc_walk_expr (expr1);
assert (ss != gfc_ss_terminator); gcc_assert (ss != gfc_ss_terminator);
gfc_init_se (&se, NULL); gfc_init_se (&se, NULL);
gfc_start_block (&se.pre); gfc_start_block (&se.pre);
se.want_pointer = 1; se.want_pointer = 1;
...@@ -2024,7 +2020,7 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2) ...@@ -2024,7 +2020,7 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2)
se.direct_byref = 1; se.direct_byref = 1;
se.ss = gfc_walk_expr (expr2); se.ss = gfc_walk_expr (expr2);
assert (se.ss != gfc_ss_terminator); gcc_assert (se.ss != gfc_ss_terminator);
gfc_conv_function_expr (&se, expr2); gfc_conv_function_expr (&se, expr2);
gfc_add_block_to_block (&se.pre, &se.post); gfc_add_block_to_block (&se.pre, &se.post);
...@@ -2075,7 +2071,7 @@ gfc_trans_assignment (gfc_expr * expr1, gfc_expr * expr2) ...@@ -2075,7 +2071,7 @@ gfc_trans_assignment (gfc_expr * expr1, gfc_expr * expr2)
&& 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);
...@@ -2146,10 +2142,8 @@ gfc_trans_assignment (gfc_expr * expr1, gfc_expr * expr2) ...@@ -2146,10 +2142,8 @@ gfc_trans_assignment (gfc_expr * expr1, gfc_expr * expr2)
} }
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)
{ {
...@@ -2168,11 +2162,8 @@ gfc_trans_assignment (gfc_expr * expr1, gfc_expr * expr2) ...@@ -2168,11 +2162,8 @@ gfc_trans_assignment (gfc_expr * expr1, gfc_expr * expr2)
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 ();
tmp = gfc_trans_scalar_assign (&lse, &rse, expr1->ts.type); tmp = gfc_trans_scalar_assign (&lse, &rse, expr1->ts.type);
gfc_add_expr_to_block (&body, tmp); gfc_add_expr_to_block (&body, tmp);
......
...@@ -33,7 +33,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -33,7 +33,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "real.h" #include "real.h"
#include "tree-gimple.h" #include "tree-gimple.h"
#include "flags.h" #include "flags.h"
#include <assert.h>
#include "gfortran.h" #include "gfortran.h"
#include "arith.h" #include "arith.h"
#include "intrinsic.h" #include "intrinsic.h"
...@@ -197,7 +196,7 @@ gfc_conv_intrinsic_conversion (gfc_se * se, gfc_expr * expr) ...@@ -197,7 +196,7 @@ gfc_conv_intrinsic_conversion (gfc_se * se, gfc_expr * expr)
/* Evaluate the argument. */ /* Evaluate the argument. */
type = gfc_typenode_for_spec (&expr->ts); type = gfc_typenode_for_spec (&expr->ts);
assert (expr->value.function.actual->expr); gcc_assert (expr->value.function.actual->expr);
arg = gfc_conv_intrinsic_function_args (se, expr); arg = gfc_conv_intrinsic_function_args (se, expr);
arg = TREE_VALUE (arg); arg = TREE_VALUE (arg);
...@@ -354,7 +353,7 @@ gfc_conv_intrinsic_aint (gfc_se * se, gfc_expr * expr, int op) ...@@ -354,7 +353,7 @@ gfc_conv_intrinsic_aint (gfc_se * se, gfc_expr * expr, int op)
} }
/* Evaluate the argument. */ /* Evaluate the argument. */
assert (expr->value.function.actual->expr); gcc_assert (expr->value.function.actual->expr);
arg = gfc_conv_intrinsic_function_args (se, expr); arg = gfc_conv_intrinsic_function_args (se, expr);
/* Use a builtin function if one exists. */ /* Use a builtin function if one exists. */
...@@ -402,7 +401,7 @@ gfc_conv_intrinsic_int (gfc_se * se, gfc_expr * expr, int op) ...@@ -402,7 +401,7 @@ gfc_conv_intrinsic_int (gfc_se * se, gfc_expr * expr, int op)
/* Evaluate the argument. */ /* Evaluate the argument. */
type = gfc_typenode_for_spec (&expr->ts); type = gfc_typenode_for_spec (&expr->ts);
assert (expr->value.function.actual->expr); gcc_assert (expr->value.function.actual->expr);
arg = gfc_conv_intrinsic_function_args (se, expr); arg = gfc_conv_intrinsic_function_args (se, expr);
arg = TREE_VALUE (arg); arg = TREE_VALUE (arg);
...@@ -499,13 +498,12 @@ gfc_get_intrinsic_lib_fndecl (gfc_intrinsic_map_t * m, gfc_expr * expr) ...@@ -499,13 +498,12 @@ gfc_get_intrinsic_lib_fndecl (gfc_intrinsic_map_t * m, gfc_expr * expr)
pdecl = &m->real8_decl; pdecl = &m->real8_decl;
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
else if (ts->type == BT_COMPLEX) else if (ts->type == BT_COMPLEX)
{ {
if (!m->complex_available) gcc_assert (m->complex_available);
abort ();
switch (ts->kind) switch (ts->kind)
{ {
...@@ -516,19 +514,18 @@ gfc_get_intrinsic_lib_fndecl (gfc_intrinsic_map_t * m, gfc_expr * expr) ...@@ -516,19 +514,18 @@ gfc_get_intrinsic_lib_fndecl (gfc_intrinsic_map_t * m, gfc_expr * expr)
pdecl = &m->complex8_decl; pdecl = &m->complex8_decl;
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
else else
abort (); gcc_unreachable ();
if (*pdecl) if (*pdecl)
return *pdecl; return *pdecl;
if (m->libm_name) if (m->libm_name)
{ {
if (ts->kind != 4 && ts->kind != 8) gcc_assert (ts->kind == 4 || ts->kind == 8);
abort ();
snprintf (name, sizeof (name), "%s%s%s", snprintf (name, sizeof (name), "%s%s%s",
ts->type == BT_COMPLEX ? "c" : "", ts->type == BT_COMPLEX ? "c" : "",
m->name, m->name,
...@@ -615,7 +612,7 @@ gfc_conv_intrinsic_exponent (gfc_se * se, gfc_expr * expr) ...@@ -615,7 +612,7 @@ gfc_conv_intrinsic_exponent (gfc_se * se, gfc_expr * expr)
fndecl = gfor_fndecl_math_exponent8; fndecl = gfor_fndecl_math_exponent8;
break; break;
default: default:
abort (); gcc_unreachable ();
} }
se->expr = gfc_build_function_call (fndecl, args); se->expr = gfc_build_function_call (fndecl, args);
...@@ -645,9 +642,9 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper) ...@@ -645,9 +642,9 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper)
if (se->ss) if (se->ss)
{ {
/* Create an implicit second parameter from the loop variable. */ /* Create an implicit second parameter from the loop variable. */
assert (!arg2->expr); gcc_assert (!arg2->expr);
assert (se->loop->dimen == 1); gcc_assert (se->loop->dimen == 1);
assert (se->ss->expr == expr); gcc_assert (se->ss->expr == expr);
gfc_advance_se_ss_chain (se); gfc_advance_se_ss_chain (se);
bound = se->loop->loopvar[0]; bound = se->loop->loopvar[0];
bound = fold (build2 (MINUS_EXPR, gfc_array_index_type, bound, bound = fold (build2 (MINUS_EXPR, gfc_array_index_type, bound,
...@@ -656,7 +653,7 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper) ...@@ -656,7 +653,7 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper)
else else
{ {
/* use the passed argument. */ /* use the passed argument. */
assert (arg->next->expr); gcc_assert (arg->next->expr);
gfc_init_se (&argse, NULL); gfc_init_se (&argse, NULL);
gfc_conv_expr_type (&argse, arg->next->expr, gfc_array_index_type); gfc_conv_expr_type (&argse, arg->next->expr, gfc_array_index_type);
gfc_add_block_to_block (&se->pre, &argse.pre); gfc_add_block_to_block (&se->pre, &argse.pre);
...@@ -669,7 +666,7 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper) ...@@ -669,7 +666,7 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper)
/* TODO: don't re-evaluate the descriptor on each iteration. */ /* TODO: don't re-evaluate the descriptor on each iteration. */
/* Get a descriptor for the first parameter. */ /* Get a descriptor for the first parameter. */
ss = gfc_walk_expr (arg->expr); ss = gfc_walk_expr (arg->expr);
assert (ss != gfc_ss_terminator); gcc_assert (ss != gfc_ss_terminator);
argse.want_pointer = 0; argse.want_pointer = 0;
gfc_conv_expr_descriptor (&argse, arg->expr, ss); gfc_conv_expr_descriptor (&argse, arg->expr, ss);
gfc_add_block_to_block (&se->pre, &argse.pre); gfc_add_block_to_block (&se->pre, &argse.pre);
...@@ -679,9 +676,9 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper) ...@@ -679,9 +676,9 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper)
if (INTEGER_CST_P (bound)) if (INTEGER_CST_P (bound))
{ {
assert (TREE_INT_CST_HIGH (bound) == 0); gcc_assert (TREE_INT_CST_HIGH (bound) == 0);
i = TREE_INT_CST_LOW (bound); i = TREE_INT_CST_LOW (bound);
assert (i >= 0 && i < GFC_TYPE_ARRAY_RANK (TREE_TYPE (desc))); gcc_assert (i >= 0 && i < GFC_TYPE_ARRAY_RANK (TREE_TYPE (desc)));
} }
else else
{ {
...@@ -716,7 +713,7 @@ gfc_conv_intrinsic_abs (gfc_se * se, gfc_expr * expr) ...@@ -716,7 +713,7 @@ gfc_conv_intrinsic_abs (gfc_se * se, gfc_expr * expr)
int n; int n;
args = gfc_conv_intrinsic_function_args (se, expr); args = gfc_conv_intrinsic_function_args (se, expr);
assert (args && TREE_CHAIN (args) == NULL_TREE); gcc_assert (args && TREE_CHAIN (args) == NULL_TREE);
val = TREE_VALUE (args); val = TREE_VALUE (args);
switch (expr->value.function.actual->expr->ts.type) switch (expr->value.function.actual->expr->ts.type)
...@@ -736,13 +733,13 @@ gfc_conv_intrinsic_abs (gfc_se * se, gfc_expr * expr) ...@@ -736,13 +733,13 @@ gfc_conv_intrinsic_abs (gfc_se * se, gfc_expr * expr)
n = BUILT_IN_CABS; n = BUILT_IN_CABS;
break; break;
default: default:
abort (); gcc_unreachable ();
} }
se->expr = fold (gfc_build_function_call (built_in_decls[n], args)); se->expr = fold (gfc_build_function_call (built_in_decls[n], args));
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -833,7 +830,7 @@ gfc_conv_intrinsic_mod (gfc_se * se, gfc_expr * expr, int modulo) ...@@ -833,7 +830,7 @@ gfc_conv_intrinsic_mod (gfc_se * se, gfc_expr * expr, int modulo)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
if (modulo) if (modulo)
...@@ -909,7 +906,7 @@ gfc_conv_intrinsic_sign (gfc_se * se, gfc_expr * expr) ...@@ -909,7 +906,7 @@ gfc_conv_intrinsic_sign (gfc_se * se, gfc_expr * expr)
tmp = built_in_decls[BUILT_IN_COPYSIGN]; tmp = built_in_decls[BUILT_IN_COPYSIGN];
break; break;
default: default:
abort (); gcc_unreachable ();
} }
se->expr = fold (gfc_build_function_call (tmp, arg)); se->expr = fold (gfc_build_function_call (tmp, arg));
return; return;
...@@ -936,7 +933,7 @@ gfc_conv_intrinsic_present (gfc_se * se, gfc_expr * expr) ...@@ -936,7 +933,7 @@ gfc_conv_intrinsic_present (gfc_se * se, gfc_expr * expr)
gfc_expr *arg; gfc_expr *arg;
arg = expr->value.function.actual->expr; arg = expr->value.function.actual->expr;
assert (arg->expr_type == EXPR_VARIABLE); gcc_assert (arg->expr_type == EXPR_VARIABLE);
se->expr = gfc_conv_expr_present (arg->symtree->n.sym); se->expr = gfc_conv_expr_present (arg->symtree->n.sym);
se->expr = convert (gfc_typenode_for_spec (&expr->ts), se->expr); se->expr = convert (gfc_typenode_for_spec (&expr->ts), se->expr);
} }
...@@ -976,7 +973,7 @@ gfc_conv_intrinsic_char (gfc_se * se, gfc_expr * expr) ...@@ -976,7 +973,7 @@ gfc_conv_intrinsic_char (gfc_se * se, gfc_expr * expr)
arg = TREE_VALUE (arg); arg = TREE_VALUE (arg);
/* We currently don't support character types != 1. */ /* We currently don't support character types != 1. */
assert (expr->ts.kind == 1); gcc_assert (expr->ts.kind == 1);
type = gfc_character1_type_node; type = gfc_character1_type_node;
var = gfc_create_var (type, "char"); var = gfc_create_var (type, "char");
...@@ -1058,7 +1055,7 @@ gfc_get_symbol_for_expr (gfc_expr * expr) ...@@ -1058,7 +1055,7 @@ gfc_get_symbol_for_expr (gfc_expr * expr)
gfc_symbol *sym; gfc_symbol *sym;
/* TODO: Add symbols for intrinsic function to the global namespace. */ /* TODO: Add symbols for intrinsic function to the global namespace. */
assert (strlen (expr->value.function.name) <= GFC_MAX_SYMBOL_LEN - 5); gcc_assert (strlen (expr->value.function.name) <= GFC_MAX_SYMBOL_LEN - 5);
sym = gfc_new_symbol (expr->value.function.name, NULL); sym = gfc_new_symbol (expr->value.function.name, NULL);
sym->ts = expr->ts; sym->ts = expr->ts;
...@@ -1086,12 +1083,12 @@ gfc_conv_intrinsic_funcall (gfc_se * se, gfc_expr * expr) ...@@ -1086,12 +1083,12 @@ gfc_conv_intrinsic_funcall (gfc_se * se, gfc_expr * expr)
{ {
gfc_symbol *sym; gfc_symbol *sym;
assert (!se->ss || se->ss->expr == expr); gcc_assert (!se->ss || se->ss->expr == expr);
if (se->ss) if (se->ss)
assert (expr->rank > 0); gcc_assert (expr->rank > 0);
else else
assert (expr->rank == 0); gcc_assert (expr->rank == 0);
sym = gfc_get_symbol_for_expr (expr); sym = gfc_get_symbol_for_expr (expr);
gfc_conv_function_call (se, sym, expr->value.function.actual); gfc_conv_function_call (se, sym, expr->value.function.actual);
...@@ -1150,7 +1147,7 @@ gfc_conv_intrinsic_anyall (gfc_se * se, gfc_expr * expr, int op) ...@@ -1150,7 +1147,7 @@ gfc_conv_intrinsic_anyall (gfc_se * se, gfc_expr * expr, int op)
/* Walk the arguments. */ /* Walk the arguments. */
arrayss = gfc_walk_expr (actual->expr); arrayss = gfc_walk_expr (actual->expr);
assert (arrayss != gfc_ss_terminator); gcc_assert (arrayss != gfc_ss_terminator);
/* Initialize the scalarizer. */ /* Initialize the scalarizer. */
gfc_init_loopinfo (&loop); gfc_init_loopinfo (&loop);
...@@ -1235,7 +1232,7 @@ gfc_conv_intrinsic_count (gfc_se * se, gfc_expr * expr) ...@@ -1235,7 +1232,7 @@ gfc_conv_intrinsic_count (gfc_se * se, gfc_expr * expr)
/* Walk the arguments. */ /* Walk the arguments. */
arrayss = gfc_walk_expr (actual->expr); arrayss = gfc_walk_expr (actual->expr);
assert (arrayss != gfc_ss_terminator); gcc_assert (arrayss != gfc_ss_terminator);
/* Initialize the scalarizer. */ /* Initialize the scalarizer. */
gfc_init_loopinfo (&loop); gfc_init_loopinfo (&loop);
...@@ -1310,15 +1307,15 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, int op) ...@@ -1310,15 +1307,15 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, int op)
actual = expr->value.function.actual; actual = expr->value.function.actual;
arrayexpr = actual->expr; arrayexpr = actual->expr;
arrayss = gfc_walk_expr (arrayexpr); arrayss = gfc_walk_expr (arrayexpr);
assert (arrayss != gfc_ss_terminator); gcc_assert (arrayss != gfc_ss_terminator);
actual = actual->next->next; actual = actual->next->next;
assert (actual); gcc_assert (actual);
maskexpr = actual->expr; maskexpr = actual->expr;
if (maskexpr) if (maskexpr)
{ {
maskss = gfc_walk_expr (maskexpr); maskss = gfc_walk_expr (maskexpr);
assert (maskss != gfc_ss_terminator); gcc_assert (maskss != gfc_ss_terminator);
} }
else else
maskss = NULL; maskss = NULL;
...@@ -1419,15 +1416,15 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op) ...@@ -1419,15 +1416,15 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op)
actual = expr->value.function.actual; actual = expr->value.function.actual;
arrayexpr = actual->expr; arrayexpr = actual->expr;
arrayss = gfc_walk_expr (arrayexpr); arrayss = gfc_walk_expr (arrayexpr);
assert (arrayss != gfc_ss_terminator); gcc_assert (arrayss != gfc_ss_terminator);
actual = actual->next->next; actual = actual->next->next;
assert (actual); gcc_assert (actual);
maskexpr = actual->expr; maskexpr = actual->expr;
if (maskexpr) if (maskexpr)
{ {
maskss = gfc_walk_expr (maskexpr); maskss = gfc_walk_expr (maskexpr);
assert (maskss != gfc_ss_terminator); gcc_assert (maskss != gfc_ss_terminator);
} }
else else
maskss = NULL; maskss = NULL;
...@@ -1446,7 +1443,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op) ...@@ -1446,7 +1443,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
/* Most negative(+HUGE) for maxval, most negative (-HUGE) for minval. */ /* Most negative(+HUGE) for maxval, most negative (-HUGE) for minval. */
...@@ -1464,7 +1461,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op) ...@@ -1464,7 +1461,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op)
gfc_conv_ss_startstride (&loop); gfc_conv_ss_startstride (&loop);
gfc_conv_loop_setup (&loop); gfc_conv_loop_setup (&loop);
assert (loop.dimen == 1); gcc_assert (loop.dimen == 1);
/* Initialize the position to the first element. If the array has zero /* Initialize the position to the first element. If the array has zero
size we need to return zero. Otherwise use the first element of the size we need to return zero. Otherwise use the first element of the
...@@ -1586,7 +1583,7 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, int op) ...@@ -1586,7 +1583,7 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, int op)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
/* Most negative(-HUGE) for maxval, most positive (-HUGE) for minval. */ /* Most negative(-HUGE) for maxval, most positive (-HUGE) for minval. */
...@@ -1598,15 +1595,15 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, int op) ...@@ -1598,15 +1595,15 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, int op)
actual = expr->value.function.actual; actual = expr->value.function.actual;
arrayexpr = actual->expr; arrayexpr = actual->expr;
arrayss = gfc_walk_expr (arrayexpr); arrayss = gfc_walk_expr (arrayexpr);
assert (arrayss != gfc_ss_terminator); gcc_assert (arrayss != gfc_ss_terminator);
actual = actual->next->next; actual = actual->next->next;
assert (actual); gcc_assert (actual);
maskexpr = actual->expr; maskexpr = actual->expr;
if (maskexpr) if (maskexpr)
{ {
maskss = gfc_walk_expr (maskexpr); maskss = gfc_walk_expr (maskexpr);
assert (maskss != gfc_ss_terminator); gcc_assert (maskss != gfc_ss_terminator);
} }
else else
maskss = NULL; maskss = NULL;
...@@ -1847,7 +1844,7 @@ gfc_conv_intrinsic_ishftc (gfc_se * se, gfc_expr * expr) ...@@ -1847,7 +1844,7 @@ gfc_conv_intrinsic_ishftc (gfc_se * se, gfc_expr * expr)
tmp = gfor_fndecl_math_ishftc8; tmp = gfor_fndecl_math_ishftc8;
break; break;
default: default:
abort (); gcc_unreachable ();
} }
se->expr = gfc_build_function_call (tmp, arg); se->expr = gfc_build_function_call (tmp, arg);
return; return;
...@@ -1884,7 +1881,7 @@ gfc_conv_intrinsic_len (gfc_se * se, gfc_expr * expr) ...@@ -1884,7 +1881,7 @@ gfc_conv_intrinsic_len (gfc_se * se, gfc_expr * expr)
gfc_se argse; gfc_se argse;
gfc_expr *arg; gfc_expr *arg;
assert (!se->ss); gcc_assert (!se->ss);
arg = expr->value.function.actual->expr; arg = expr->value.function.actual->expr;
...@@ -1910,7 +1907,7 @@ gfc_conv_intrinsic_len (gfc_se * se, gfc_expr * expr) ...@@ -1910,7 +1907,7 @@ gfc_conv_intrinsic_len (gfc_se * se, gfc_expr * expr)
decl = gfc_get_fake_result_decl (sym); decl = gfc_get_fake_result_decl (sym);
len = sym->ts.cl->backend_decl; len = sym->ts.cl->backend_decl;
assert (len); gcc_assert (len);
} }
else else
{ {
...@@ -1979,7 +1976,7 @@ gfc_conv_intrinsic_ichar (gfc_se * se, gfc_expr * expr) ...@@ -1979,7 +1976,7 @@ gfc_conv_intrinsic_ichar (gfc_se * se, gfc_expr * expr)
arg = gfc_conv_intrinsic_function_args (se, expr); arg = gfc_conv_intrinsic_function_args (se, expr);
arg = TREE_VALUE (TREE_CHAIN (arg)); arg = TREE_VALUE (TREE_CHAIN (arg));
assert (POINTER_TYPE_P (TREE_TYPE (arg))); gcc_assert (POINTER_TYPE_P (TREE_TYPE (arg)));
arg = build1 (NOP_EXPR, pchar_type_node, arg); arg = build1 (NOP_EXPR, pchar_type_node, arg);
type = gfc_typenode_for_spec (&expr->ts); type = gfc_typenode_for_spec (&expr->ts);
...@@ -2041,7 +2038,7 @@ gfc_conv_intrinsic_size (gfc_se * se, gfc_expr * expr) ...@@ -2041,7 +2038,7 @@ gfc_conv_intrinsic_size (gfc_se * se, gfc_expr * expr)
actual = expr->value.function.actual; actual = expr->value.function.actual;
ss = gfc_walk_expr (actual->expr); ss = gfc_walk_expr (actual->expr);
assert (ss != gfc_ss_terminator); gcc_assert (ss != gfc_ss_terminator);
argse.want_pointer = 1; argse.want_pointer = 1;
gfc_conv_expr_descriptor (&argse, actual->expr, ss); gfc_conv_expr_descriptor (&argse, actual->expr, ss);
gfc_add_block_to_block (&se->pre, &argse.pre); gfc_add_block_to_block (&se->pre, &argse.pre);
...@@ -2119,7 +2116,7 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr) ...@@ -2119,7 +2116,7 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr)
tree ptr; tree ptr;
gfc_ss *ss; gfc_ss *ss;
assert (!se->ss); gcc_assert (!se->ss);
/* Get a pointer to the source. */ /* Get a pointer to the source. */
arg = expr->value.function.actual; arg = expr->value.function.actual;
...@@ -2228,7 +2225,7 @@ gfc_conv_associated (gfc_se *se, gfc_expr *expr) ...@@ -2228,7 +2225,7 @@ gfc_conv_associated (gfc_se *se, gfc_expr *expr)
if (ss1 == gfc_ss_terminator) if (ss1 == gfc_ss_terminator)
{ {
/* A pointer to a scalar. */ /* A pointer to a scalar. */
assert (ss2 == gfc_ss_terminator); gcc_assert (ss2 == gfc_ss_terminator);
arg1se.want_pointer = 1; arg1se.want_pointer = 1;
gfc_conv_expr (&arg1se, arg1->expr); gfc_conv_expr (&arg1se, arg1->expr);
arg2se.want_pointer = 1; arg2se.want_pointer = 1;
...@@ -2239,7 +2236,7 @@ gfc_conv_associated (gfc_se *se, gfc_expr *expr) ...@@ -2239,7 +2236,7 @@ gfc_conv_associated (gfc_se *se, gfc_expr *expr)
else else
{ {
/* A pointer to an array, call library function _gfor_associated. */ /* A pointer to an array, call library function _gfor_associated. */
assert (ss2 != gfc_ss_terminator); gcc_assert (ss2 != gfc_ss_terminator);
args = NULL_TREE; args = NULL_TREE;
arg1se.want_pointer = 1; arg1se.want_pointer = 1;
gfc_conv_expr_descriptor (&arg1se, arg1->expr, ss1); gfc_conv_expr_descriptor (&arg1se, arg1->expr, ss1);
...@@ -2339,7 +2336,7 @@ void prepare_arg_info (gfc_se * se, gfc_expr * expr, ...@@ -2339,7 +2336,7 @@ void prepare_arg_info (gfc_se * se, gfc_expr * expr,
if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT) if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT)
gfc_todo_error ("Non-IEEE floating format"); gfc_todo_error ("Non-IEEE floating format");
assert (expr->expr_type == EXPR_FUNCTION); gcc_assert (expr->expr_type == EXPR_FUNCTION);
arg = gfc_conv_intrinsic_function_args (se, expr); arg = gfc_conv_intrinsic_function_args (se, expr);
arg = TREE_VALUE (arg); arg = TREE_VALUE (arg);
...@@ -2404,7 +2401,7 @@ call_builtin_clz (tree result_type, tree op0) ...@@ -2404,7 +2401,7 @@ call_builtin_clz (tree result_type, tree op0)
else if (op0_mode == TYPE_MODE (long_long_integer_type_node)) else if (op0_mode == TYPE_MODE (long_long_integer_type_node))
fn = built_in_decls[BUILT_IN_CLZLL]; fn = built_in_decls[BUILT_IN_CLZLL];
else else
abort (); gcc_unreachable ();
parms = tree_cons (NULL, op0, NULL); parms = tree_cons (NULL, op0, NULL);
call = gfc_build_function_call (fn, parms); call = gfc_build_function_call (fn, parms);
...@@ -2671,7 +2668,7 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr) ...@@ -2671,7 +2668,7 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
switch (expr->value.function.isym->generic_id) switch (expr->value.function.isym->generic_id)
{ {
case GFC_ISYM_NONE: case GFC_ISYM_NONE:
abort (); gcc_unreachable ();
case GFC_ISYM_REPEAT: case GFC_ISYM_REPEAT:
gfc_conv_intrinsic_repeat (se, expr); gfc_conv_intrinsic_repeat (se, expr);
...@@ -2981,8 +2978,7 @@ gfc_add_intrinsic_ss_code (gfc_loopinfo * loop ATTRIBUTE_UNUSED, gfc_ss * ss) ...@@ -2981,8 +2978,7 @@ gfc_add_intrinsic_ss_code (gfc_loopinfo * loop ATTRIBUTE_UNUSED, gfc_ss * ss)
break; break;
default: default:
abort (); gcc_unreachable ();
break;
} }
} }
...@@ -3015,7 +3011,7 @@ gfc_walk_intrinsic_libfunc (gfc_ss * ss, gfc_expr * expr) ...@@ -3015,7 +3011,7 @@ gfc_walk_intrinsic_libfunc (gfc_ss * ss, gfc_expr * expr)
{ {
gfc_ss *newss; gfc_ss *newss;
assert (expr->rank > 0); gcc_assert (expr->rank > 0);
newss = gfc_get_ss (); newss = gfc_get_ss ();
newss->type = GFC_SS_FUNCTION; newss->type = GFC_SS_FUNCTION;
...@@ -3034,8 +3030,8 @@ gfc_walk_intrinsic_libfunc (gfc_ss * ss, gfc_expr * expr) ...@@ -3034,8 +3030,8 @@ gfc_walk_intrinsic_libfunc (gfc_ss * ss, gfc_expr * expr)
int int
gfc_is_intrinsic_libcall (gfc_expr * expr) gfc_is_intrinsic_libcall (gfc_expr * expr)
{ {
assert (expr->expr_type == EXPR_FUNCTION && expr->value.function.isym); gcc_assert (expr->expr_type == EXPR_FUNCTION && expr->value.function.isym);
assert (expr->rank > 0); gcc_assert (expr->rank > 0);
switch (expr->value.function.isym->generic_id) switch (expr->value.function.isym->generic_id)
{ {
...@@ -3073,7 +3069,7 @@ gfc_ss * ...@@ -3073,7 +3069,7 @@ gfc_ss *
gfc_walk_intrinsic_function (gfc_ss * ss, gfc_expr * expr, gfc_walk_intrinsic_function (gfc_ss * ss, gfc_expr * expr,
gfc_intrinsic_sym * isym) gfc_intrinsic_sym * isym)
{ {
assert (isym); gcc_assert (isym);
if (isym->elemental) if (isym->elemental)
return gfc_walk_elemental_function_args (ss, expr, GFC_SS_SCALAR); return gfc_walk_elemental_function_args (ss, expr, GFC_SS_SCALAR);
......
...@@ -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