* 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
+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>
Paul Brook <paul@codesourcery.com>
#include "match.h"
#include <string.h>
-#include <assert.h>
/* This parameter is the size of the largest array constructor that we
will expand to an array constructor without iterators.
#include "config.h"
#include "gfortran.h"
-#include "assert.h"
static void formalize_init_expr (gfc_expr *);
if (ref)
{
- assert (ref->type == REF_SUBSTRING);
+ gcc_assert (ref->type == REF_SUBSTRING);
/* Only set a substring of the destination. Fortran substring bounds
are one-based [start, end], we want zero based [start, end). */
if (ref->type == REF_SUBSTRING)
{
/* A substring should always br the last subobject reference. */
- assert (ref->next == NULL);
+ gcc_assert (ref->next == NULL);
break;
}
expr->rank = ref->u.ar.as->rank;
}
else
- assert (expr->expr_type == EXPR_ARRAY);
+ gcc_assert (expr->expr_type == EXPR_ARRAY);
if (ref->u.ar.type == AR_ELEMENT)
get_array_index (&ref->u.ar, &offset);
expr->ts.derived = ref->u.c.sym;
}
else
- assert (expr->expr_type == EXPR_STRUCTURE);
+ gcc_assert (expr->expr_type == EXPR_STRUCTURE);
last_ts = &ref->u.c.component->ts;
/* Find the same element in the existing constructor. */
break;
default:
- abort ();
+ gcc_unreachable ();
}
if (init == NULL)
else
{
/* We should never be overwriting an existing initializer. */
- assert (!init);
+ gcc_assert (!init);
expr = gfc_copy_expr (rvalue);
if (!gfc_compare_types (&lvalue->ts, &expr->ts))
expr->rank = ref->u.ar.as->rank;
}
else
- assert (expr->expr_type == EXPR_ARRAY);
+ gcc_assert (expr->expr_type == EXPR_ARRAY);
if (ref->u.ar.type == AR_ELEMENT)
{
/* This had better not be the bottom of the reference.
We can still get to a full array via a component. */
- assert (ref->next != NULL);
+ gcc_assert (ref->next != NULL);
}
else
{
/* We're at a full array or an array section. This means
that we've better have found a full array, and that we're
at the bottom of the reference. */
- assert (ref->u.ar.type == AR_FULL);
- assert (ref->next == NULL);
+ gcc_assert (ref->u.ar.type == AR_FULL);
+ gcc_assert (ref->next == NULL);
}
/* Find the same element in the existing constructor. */
gfc_insert_constructor (expr, con);
}
else
- assert (ref->next != NULL);
+ gcc_assert (ref->next != NULL);
break;
case REF_COMPONENT:
expr->ts.derived = ref->u.c.sym;
}
else
- assert (expr->expr_type == EXPR_STRUCTURE);
+ gcc_assert (expr->expr_type == EXPR_STRUCTURE);
last_ts = &ref->u.c.component->ts;
/* Find the same element in the existing constructor. */
/* Since we're only intending to initialize arrays here,
there better be an inner reference. */
- assert (ref->next != NULL);
+ gcc_assert (ref->next != NULL);
break;
case REF_SUBSTRING:
default:
- abort ();
+ gcc_unreachable ();
}
if (init == NULL)
}
/* We should never be overwriting an existing initializer. */
- assert (!init);
+ gcc_assert (!init);
expr = gfc_copy_expr (rvalue);
if (!gfc_compare_types (&lvalue->ts, &expr->ts))
tail = tail->next;
}
}
- assert (c == NULL);
+ gcc_assert (c == NULL);
expr->value.constructor = head;
}
gfc_internal_error ("TODO: Vector sections in data statements");
default:
- abort ();
+ gcc_unreachable ();
}
mpz_sub (tmp, ar->as->upper[i]->value.integer,
#include "config.h"
#include "gfortran.h"
#include "dependency.h"
-#include <assert.h>
/* static declarations */
/* Enums */
int
gfc_expr_is_one (gfc_expr * expr, int def)
{
- assert (expr != NULL);
+ gcc_assert (expr != NULL);
if (expr->expr_type != EXPR_CONSTANT)
return def;
int i;
/* 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];
e2 = ar2->stride[n];
gfc_expr *expr;
int n;
- assert (dest->expr_type == EXPR_VARIABLE
+ gcc_assert (dest->expr_type == EXPR_VARIABLE
&& fncall->expr_type == EXPR_FUNCTION);
- assert (fncall->rank > 0);
+ gcc_assert (fncall->rank > 0);
for (actual = fncall->value.function.actual; actual; actual = actual->next)
{
if (ref->type == REF_ARRAY && ref->u.ar.type != AR_ELEMENT)
break;
}
- assert (ref);
+ gcc_assert (ref);
/* AR_FULL can't contain vector subscripts. */
if (ref->u.ar.type == AR_SECTION)
{
int n;
gfc_actual_arglist *actual;
- assert (expr1->expr_type == EXPR_VARIABLE);
+ gcc_assert (expr1->expr_type == EXPR_VARIABLE);
/* TODO: -fassume-no-pointer-aliasing */
if (expr1->symtree->n.sym->attr.pointer)
/* 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
that are not equal. */
- assert (lref->type == rref->type);
+ gcc_assert (lref->type == rref->type);
switch (lref->type)
{
case REF_COMPONENT:
this_dep = gfc_check_element_vs_section (rref, lref, n);
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);
this_dep = gfc_check_element_vs_element (rref, lref, n);
}
break;
default:
- abort();
+ gcc_unreachable ();
}
lref = lref->next;
rref = rref->next;
}
/* 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)
return 0;
#include "trans-types.h"
#include "trans-const.h"
-#include <assert.h>
#include <stdio.h>
/* Language-dependent contents of an identifier. */
#include "config.h"
#include <string.h>
#include <stdarg.h>
-#include <assert.h>
#include "gfortran.h"
#include "intrinsic.h"
#include "config.h"
#include "gfortran.h"
#include "arith.h" /* For gfc_compare_expr(). */
-#include <assert.h>
#include <string.h>
/* Stack to push the current if we descend into a block during
return;
/* 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. */
old_ns = gfc_current_ns;
master_count++, ns->proc_name->name);
name[GFC_MAX_SYMBOL_LEN] = '\0';
gfc_get_ha_symbol (name, &proc);
- assert (proc != NULL);
+ gcc_assert (proc != NULL);
gfc_add_procedure (&proc->attr, PROC_INTERNAL, NULL);
if (ns->proc_name->attr.subroutine)
switch (expr->expr_type)
{
case EXPR_VARIABLE:
- assert (expr->symtree->n.sym);
+ gcc_assert (expr->symtree->n.sym);
/* A scalar assignment */
if (!expr->ref)
if (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)
return SUCCESS;
if (gfc_find_forall_index (tmp->u.ss.end, symbol) == SUCCESS)
break;
case EXEC_IOLENGTH:
- assert(code->ext.inquire != NULL);
+ gcc_assert (code->ext.inquire != NULL);
if (gfc_resolve_inquire (code->ext.inquire) == FAILURE)
break;
continue;
break;
}
- assert (ref);
+ gcc_assert (ref);
/* Set marks asscording to the reference pattern. */
switch (ref->u.ar.type)
break;
default:
- abort();
+ gcc_unreachable ();
}
if (gfc_array_size (e, &size) == FAILURE)
break;
default:
- abort ();
+ gcc_unreachable ();
}
return gfc_int_expr (digits);
break;
default:
- abort ();
+ gcc_unreachable ();
}
return result;
break;
default:
- abort ();
+ gcc_unreachable ();
}
result = gfc_int_expr (i);
break;
default:
- abort ();
+ gcc_unreachable ();
}
result = gfc_int_expr (j);
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include <assert.h>
#include "gfortran.h"
#include "parse.h"
ns->refs--;
if (ns->refs > 0)
return;
- assert (ns->refs == 0);
+ gcc_assert (ns->refs == 0);
gfc_free_statements (ns->code);
#include "toplev.h"
#include "real.h"
#include "flags.h"
-#include <assert.h>
#include <gmp.h>
#include "gfortran.h"
#include "trans.h"
tree type;
type = TREE_TYPE (desc);
- assert (GFC_DESCRIPTOR_TYPE_P (type));
+ gcc_assert (GFC_DESCRIPTOR_TYPE_P (type));
field = TYPE_FIELDS (type);
- assert (DATA_FIELD == 0);
- assert (field != NULL_TREE
+ gcc_assert (DATA_FIELD == 0);
+ gcc_assert (field != NULL_TREE
&& TREE_CODE (TREE_TYPE (field)) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (TREE_TYPE (field))) == ARRAY_TYPE);
tree field;
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);
- 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);
}
tree type;
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);
- 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);
}
tree tmp;
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);
- assert (field != NULL_TREE
+ gcc_assert (field != NULL_TREE
&& TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE
&& TREE_CODE (TREE_TYPE (TREE_TYPE (field))) == RECORD_TYPE);
tmp = gfc_conv_descriptor_dimension (desc, dim);
field = TYPE_FIELDS (TREE_TYPE (tmp));
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);
return tmp;
tmp = gfc_conv_descriptor_dimension (desc, dim);
field = TYPE_FIELDS (TREE_TYPE (tmp));
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);
return tmp;
tmp = gfc_conv_descriptor_dimension (desc, dim);
field = TYPE_FIELDS (TREE_TYPE (tmp));
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);
return tmp;
tree field;
tree tmp;
- assert (GFC_DESCRIPTOR_TYPE_P (type));
- assert (DATA_FIELD == 0);
+ gcc_assert (GFC_DESCRIPTOR_TYPE_P (type));
+ gcc_assert (DATA_FIELD == 0);
field = TYPE_FIELDS (type);
/* Set a NULL data pointer. */
while (ss != gfc_ss_terminator)
{
- assert (ss != NULL);
+ gcc_assert (ss != NULL);
next = ss->next;
gfc_free_ss (ss);
ss = next;
ss = loop->ss;
while (ss != gfc_ss_terminator)
{
- assert (ss != NULL);
+ gcc_assert (ss != NULL);
next = ss->loop_chain;
gfc_free_ss (ss);
ss = next;
else
ss->loop_chain = ss->next;
}
- assert (ss == gfc_ss_terminator);
+ gcc_assert (ss == gfc_ss_terminator);
loop->ss = head;
}
{
tree type;
- assert (TREE_STATIC (sym->backend_decl));
+ gcc_assert (TREE_STATIC (sym->backend_decl));
/* Just zero the data member. */
type = TREE_TYPE (sym->backend_decl);
DECL_INITIAL (sym->backend_decl) =gfc_build_null_descriptor (type);
else if (gfc_index_integer_kind == 8)
tmp = gfor_fndecl_internal_malloc64;
else
- abort ();
+ gcc_unreachable ();
tmp = gfc_build_function_call (tmp, args);
tmp = convert (TREE_TYPE (data), tmp);
gfc_add_modify_expr (&loop->pre, data, tmp);
int n;
int dim;
- assert (info->dimen > 0);
+ gcc_assert (info->dimen > 0);
/* Set the lower bound to zero. */
for (dim = 0; dim < info->dimen; dim++)
{
n = loop->order[dim];
if (n < loop->temp_dim)
- assert (integer_zerop (loop->from[n]));
+ gcc_assert (integer_zerop (loop->from[n]));
else
{
/* Callee allocated arrays may not have a known bound yet. */
{
/* We should have already created the offset variable. We cannot
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);
*poffset = *offsetvar;
TREE_USED (*offsetvar) = 1;
/* Walk the array expression. */
ss = gfc_walk_expr (expr);
- assert (ss != gfc_ss_terminator);
+ gcc_assert (ss != gfc_ss_terminator);
/* Initialize the scalarizer. */
gfc_init_loopinfo (&loop);
gfc_todo_error ("character arrays in constructors");
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. */
tmp = build2 (PLUS_EXPR, gfc_array_index_type, *poffset, gfc_index_one_node);
if (TREE_USED (offsetvar))
pushdecl (offsetvar);
else
- assert (INTEGER_CST_P (offset));
+ gcc_assert (INTEGER_CST_P (offset));
#if 0
/* Disable bound checking for now because it's probably broken. */
if (flag_bounds_check)
{
- abort ();
+ gcc_unreachable ();
}
#endif
}
/* TODO: This can generate bad code if there are ordering dependencies.
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)
{
- assert (ss);
+ gcc_assert (ss);
switch (ss->type)
{
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
}
tree tmp;
/* 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);
se.descriptor_only = 1;
gfc_conv_expr_lhs (&se, ss->expr);
tmp = gfc_build_array_ref (array, index);
/* 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;
}
gfc_ss_info *info;
int n;
- assert (ss && ss->type == GFC_SS_VECTOR);
+ gcc_assert (ss && ss->type == GFC_SS_VECTOR);
/* Save the descriptor. */
descsave = se->expr;
switch (ar->dimen_type[n])
{
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);
indices[n] = info->subscript[n]->data.scalar.expr;
break;
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
/* Get the index from the vector. */
/* Get the index into the array for this dimension. */
if (ar)
{
- assert (ar->type != AR_ELEMENT);
+ gcc_assert (ar->type != AR_ELEMENT);
if (ar->dimen_type[dim] == DIMEN_ELEMENT)
{
- assert (i == -1);
+ gcc_assert (i == -1);
/* Elemental dimension. */
- assert (info->subscript[dim]
+ gcc_assert (info->subscript[dim]
&& info->subscript[dim]->type == GFC_SS_SCALAR);
/* We've already translated this value outside the loop. */
index = info->subscript[dim]->data.scalar.expr;
else
{
/* Scalarized dimension. */
- assert (info && se->loop);
+ gcc_assert (info && se->loop);
/* Multiply the loop variable by the stride and dela. */
index = se->loop->loopvar[i];
dim);
}
else
- assert (ar->dimen_type[dim] == DIMEN_RANGE);
+ gcc_assert (ar->dimen_type[dim] == DIMEN_RANGE);
}
}
else
{
/* Temporary array or derived type component. */
- assert (se->loop);
+ gcc_assert (se->loop);
index = se->loop->loopvar[se->loop->order[i]];
if (!integer_zerop (info->delta[i]))
index = fold (build2 (PLUS_EXPR, gfc_array_index_type,
int n;
int flags;
- assert (!loop->array_parameter);
+ gcc_assert (!loop->array_parameter);
for (dim = loop->dimen - 1; dim >= 0; dim--)
{
tree bound;
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. */
dim = ss->data.info.dim[n];
while (vecss->data.info.ref->u.ar.dimen_type[dim] == DIMEN_VECTOR)
{
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];
}
- 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];
desc = vecss->data.info.descriptor;
while (vecss->data.info.ref->u.ar.dimen_type[dim] == DIMEN_VECTOR)
{
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. */
if (!vecss->data.info.descriptor)
gfc_conv_ss_descriptor (&loop->pre, vecss, !loop->array_parameter);
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];
stride = vecss->data.info.ref->u.ar.stride[dim];
desc = vecss->data.info.descriptor;
== DIMEN_VECTOR)
{
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];
}
- assert (vecss->data.info.ref->u.ar.dimen_type[dim]
+ gcc_assert (vecss->data.info.ref->u.ar.dimen_type[dim]
== DIMEN_RANGE);
desc = vecss->data.info.descriptor;
dim = 0;
for (n = 0; n < loop->dimen; n++)
{
- assert (loop->order[n] == n);
+ gcc_assert (loop->order[n] == n);
if (depends[n])
loop->order[dim++] = n;
}
loop->order[dim++] = n;
}
- assert (dim == loop->dimen);
+ gcc_assert (dim == loop->dimen);
break;
}
#endif
/* An unknown size constructor will always be rank one.
Higher rank constructors will either have known shape,
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. */
/* TODO: avoid this by making the frontend set the shape. */
gfc_get_array_cons_size (&i, ss->expr->value.constructor);
switch (loopspec[n]->type)
{
case GFC_SS_CONSTRUCTOR:
- assert (info->dimen == 1);
- assert (loop->to[n]);
+ gcc_assert (info->dimen == 1);
+ gcc_assert (loop->to[n]);
break;
case GFC_SS_SECTION:
case GFC_SS_FUNCTION:
/* 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;
default:
- abort ();
+ gcc_unreachable ();
}
}
/* If we want a temporary then create it. */
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;
len = loop->temp_ss->string_length;
n = loop->temp_ss->data.temp.dimen;
se.expr = gfc_index_one_node;
else
{
- assert (lower[n]);
+ gcc_assert (lower[n]);
if (ubound)
{
gfc_conv_expr_type (&se, lower[n], gfc_array_index_type);
/* Set upper bound. */
gfc_init_se (&se, NULL);
- assert (ubound);
+ gcc_assert (ubound);
gfc_conv_expr_type (&se, ubound, gfc_array_index_type);
gfc_add_block_to_block (pblock, &se.pre);
break;
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;
upper = ref->u.ar.as->upper;
break;
default:
- abort ();
+ gcc_unreachable ();
break;
}
else if (TYPE_PRECISION (gfc_array_index_type) == 64)
allocate = gfor_fndecl_allocate64;
else
- abort ();
+ gcc_unreachable ();
tmp = gfc_chainon_list (NULL_TREE, pointer);
tmp = gfc_chainon_list (tmp, size);
gfc_conv_structure (&se, expr, 1);
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);
lo = TREE_INT_CST_LOW (tmp);
lo++;
break;
default:
- abort();
+ gcc_unreachable ();
}
}
/* We created the list in reverse order. */
break;
default:
- abort();
+ gcc_unreachable ();
}
/* Create a constructor from the list of elements. */
tree offset;
bool onstack;
- assert (!(sym->attr.pointer || sym->attr.allocatable));
+ gcc_assert (!(sym->attr.pointer || sym->attr.allocatable));
/* Do nothing for USEd variables. */
if (sym->attr.use_assoc)
return fnbody;
type = TREE_TYPE (decl);
- assert (GFC_ARRAY_TYPE_P (type));
+ gcc_assert (GFC_ARRAY_TYPE_P (type));
onstack = TREE_CODE (type) != POINTER_TYPE;
gfc_start_block (&block);
type = TREE_TYPE (type);
- assert (!sym->attr.use_assoc);
- assert (!TREE_STATIC (decl));
- assert (!sym->module[0]);
+ gcc_assert (!sym->attr.use_assoc);
+ gcc_assert (!TREE_STATIC (decl));
+ gcc_assert (!sym->module[0]);
if (sym->ts.type == BT_CHARACTER
&& !INTEGER_CST_P (sym->ts.cl->backend_decl))
else if (gfc_index_integer_kind == 8)
fndecl = gfor_fndecl_internal_malloc64;
else
- abort ();
+ gcc_unreachable ();
tmp = gfc_build_function_call (fndecl, tmp);
tmp = fold (convert (TREE_TYPE (decl), tmp));
gfc_add_modify_expr (&block, decl, tmp);
/* Automatic arrays should not have initializers. */
- assert (!sym->value);
+ gcc_assert (!sym->value);
gfc_add_expr_to_block (&block, fnbody);
/* Descriptor type. */
parm = sym->backend_decl;
type = TREE_TYPE (parm);
- assert (GFC_ARRAY_TYPE_P (type));
+ gcc_assert (GFC_ARRAY_TYPE_P (type));
gfc_start_block (&block);
/* Descriptor type. */
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_build_indirect_ref (dumdesc);
gfc_start_block (&block);
}
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. */
tmp = GFC_DECL_SAVED_DESCRIPTOR (tmpdesc);
tmp = gfc_chainon_list (NULL_TREE, tmp);
int full;
gfc_ss *vss;
- assert (ss != gfc_ss_terminator);
+ gcc_assert (ss != gfc_ss_terminator);
/* TODO: Pass constant array constructors without a temporary. */
/* Special case things we know we can pass easily. */
while (secss != gfc_ss_terminator && secss->type != GFC_SS_SECTION)
secss = secss->next;
- assert (secss != gfc_ss_terminator);
+ gcc_assert (secss != gfc_ss_terminator);
need_tmp = 0;
for (n = 0; n < secss->data.info.dimen; n++)
full = 0;
else
{
- assert (info->ref->u.ar.type == AR_SECTION);
+ gcc_assert (info->ref->u.ar.type == AR_SECTION);
full = 1;
for (n = 0; n < info->ref->u.ar.dimen; n++)
if (se->direct_byref)
{
- assert (secss != gfc_ss_terminator);
+ gcc_assert (secss != gfc_ss_terminator);
/* For pointer assignments pass the descriptor directly. */
se->ss = secss;
if (!need_tmp)
loop.array_parameter = 1;
else
- assert (se->want_pointer && !se->direct_byref);
+ gcc_assert (se->want_pointer && !se->direct_byref);
/* Setup the scalarizing loops and bounds. */
gfc_conv_ss_startstride (&loop);
tmp = gfc_conv_descriptor_stride (desc, gfc_rank_cst[0]);
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);
}
else if (expr->expr_type == EXPR_FUNCTION)
se->string_length = expr->symtree->n.sym->ts.cl->backend_decl;
desc = info->descriptor;
- assert (secss && secss != gfc_ss_terminator);
+ gcc_assert (secss && secss != gfc_ss_terminator);
if (se->direct_byref)
{
/* For pointer assignments we fill in the destination. */
/* Work out the offset. */
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);
start = info->subscript[n]->data.scalar.expr;
}
else
{
/* 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. */
start = info->start[dim];
}
/* 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. */
from = loop.from[dim];
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
&& !INTEGER_CST_P (sym->ts.cl->backend_decl))
gfc_trans_init_string_length (sym->ts.cl, &fnblock);
/* Get the descriptor type. */
type = TREE_TYPE (sym->backend_decl);
- assert (GFC_DESCRIPTOR_TYPE_P (type));
+ gcc_assert (GFC_DESCRIPTOR_TYPE_P (type));
/* NULLIFY the data pointer. */
tmp = gfc_conv_descriptor_data (descriptor);
newss->data.info.dim[n] = n;
ar->dimen_type[n] = DIMEN_RANGE;
- assert (ar->start[n] == NULL);
- assert (ar->end[n] == NULL);
- assert (ar->stride[n] == NULL);
+ gcc_assert (ar->start[n] == NULL);
+ gcc_assert (ar->end[n] == NULL);
+ gcc_assert (ar->stride[n] == NULL);
}
return newss;
{
case DIMEN_ELEMENT:
/* Add SS for elemental (scalar) subscripts. */
- assert (ar->start[n]);
+ gcc_assert (ar->start[n]);
indexss = gfc_get_ss ();
indexss->type = GFC_SS_SCALAR;
indexss->expr = ar->start[n];
default:
/* We should know what sort of section it is by now. */
- abort ();
+ gcc_unreachable ();
}
}
/* We should have at least one non-elemental dimension. */
- assert (newss->data.info.dimen > 0);
+ gcc_assert (newss->data.info.dimen > 0);
return head;
break;
default:
/* We should know what sort of section it is by now. */
- abort ();
+ gcc_unreachable ();
}
}
while (head && head->next != ss)
head = head->next;
/* Check we haven't somehow broken the chain. */
- assert (head);
+ gcc_assert (head);
newss->next = ss;
head->next = newss;
newss->expr = expr->op1;
}
else /* head2 == head */
{
- assert (head2 == head);
+ gcc_assert (head2 == head);
/* Second operand is scalar. */
newss->next = head2;
head2 = newss;
gfc_ss *next;
gfc_ss *head;
- assert (ss != NULL);
+ gcc_assert (ss != NULL);
head = gfc_ss_terminator;
while (ss != gfc_ss_terminator)
{
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;
head = ss;
ss = next;
#include "trans.h"
#include "trans-types.h"
#include "trans-const.h"
-#include <assert.h>
/* Holds a single variable in a equivalence set. */
offset = s->offset + s->length;
}
}
- assert (list);
+ gcc_assert (list);
ctor = build1 (CONSTRUCTOR, union_type, nreverse(list));
TREE_CONSTANT (ctor) = 1;
TREE_INVARIANT (ctor) = 1;
#ifdef ENABLE_CHECKING
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
}
#include "toplev.h"
#include "real.h"
#include <gmp.h>
-#include <assert.h>
#include <math.h>
#include "gfortran.h"
#include "trans.h"
break;
default:
- abort ();
+ gcc_unreachable ();
}
return val;
}
int slen;
tree str;
- assert (expr->expr_type == EXPR_CONSTANT);
- assert (expr->ts.type == BT_CHARACTER && expr->ts.kind == 1);
- assert (INTEGER_CST_P (length));
- assert (TREE_INT_CST_HIGH (length) == 0);
+ gcc_assert (expr->expr_type == EXPR_CONSTANT);
+ gcc_assert (expr->ts.type == BT_CHARACTER && expr->ts.kind == 1);
+ gcc_assert (INTEGER_CST_P (length));
+ gcc_assert (TREE_INT_CST_HIGH (length) == 0);
len = TREE_INT_CST_LOW (length);
slen = expr->value.character.length;
/* 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
that the middle-end can handle. */
- assert (count == 1 || count == 2);
+ gcc_assert (count == 1 || count == 2);
low = words[0];
high = words[1];
if (gfc_real_kinds[n].kind == kind)
break;
}
- assert (gfc_real_kinds[n].kind);
+ gcc_assert (gfc_real_kinds[n].kind);
n = MAX (abs (gfc_real_kinds[n].min_exponent),
abs (gfc_real_kinds[n].max_exponent));
tree
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)
{
void
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)
{
- assert (se->ss != gfc_ss_terminator);
- assert (se->ss->type == GFC_SS_SCALAR);
- assert (se->ss->expr == expr);
+ gcc_assert (se->ss != gfc_ss_terminator);
+ gcc_assert (se->ss->type == GFC_SS_SCALAR);
+ gcc_assert (se->ss->expr == expr);
se->expr = se->ss->data.scalar.expr;
se->string_length = se->ss->string_length;
#include "errors.h"
#include "flags.h"
#include "cgraph.h"
-#include <assert.h>
#include "gfortran.h"
#include "trans.h"
#include "trans-types.h"
static void
gfc_add_decl_to_parent_function (tree decl)
{
- assert (decl);
+ gcc_assert (decl);
DECL_CONTEXT (decl) = DECL_CONTEXT (current_function_decl);
DECL_NONLOCAL (decl) = 1;
TREE_CHAIN (decl) = saved_parent_function_decls;
void
gfc_add_decl_to_function (tree decl)
{
- assert (decl);
+ gcc_assert (decl);
TREE_USED (decl) = 1;
DECL_CONTEXT (decl) = current_function_decl;
TREE_CHAIN (decl) = saved_function_decls;
tree label_decl;
/* 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. */
sprintf (label_name, "__label_%.6d", lp->value);
gfc_finish_decl (tree decl, tree init)
{
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
-- it overlaps DECL_ARG_TYPE. */
else if (init == NULL_TREE)
- assert (DECL_INITIAL (decl) == NULL_TREE);
+ gcc_assert (DECL_INITIAL (decl) == NULL_TREE);
else
- assert (DECL_INITIAL (decl) == error_mark_node);
+ gcc_assert (DECL_INITIAL (decl) == error_mark_node);
if (init != NULL_TREE)
{
else if (sym->module[0] && !sym->attr.result)
{
/* 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. */
TREE_PUBLIC (decl) = 1;
TREE_STATIC (decl) = 1;
if (GFC_DESCRIPTOR_TYPE_P (type))
return;
- assert (GFC_ARRAY_TYPE_P (type));
+ gcc_assert (GFC_ARRAY_TYPE_P (type));
nest = (sym->ns->proc_name->backend_decl != current_function_decl)
&& !sym->attr.contained;
gfc_defer_symbol_init (sym);
type = TREE_TYPE (dummy);
- assert (TREE_CODE (dummy) == PARM_DECL
+ gcc_assert (TREE_CODE (dummy) == PARM_DECL
&& POINTER_TYPE_P (type));
/* Do we know the element size? */
{
/* For descriptorless arrays with known element size the actual
argument is sufficient. */
- assert (GFC_ARRAY_TYPE_P (type));
+ gcc_assert (GFC_ARRAY_TYPE_P (type));
gfc_build_qualified_array (dummy, sym);
return dummy;
}
/* We should never get deferred shape arrays here. We used to because of
frontend bugs. */
- assert (sym->as->type != AS_DEFERRED);
+ gcc_assert (sym->as->type != AS_DEFERRED);
switch (packed)
{
{
tree length;
- assert (sym->ts.cl);
+ gcc_assert (sym->ts.cl);
gfc_conv_const_charlen (sym->ts.cl);
if (sym->ts.cl->backend_decl == NULL_TREE)
tree length = NULL_TREE;
int byref;
- assert (sym->attr.referenced);
+ gcc_assert (sym->attr.referenced);
if (sym->ns && sym->ns->proc_name->attr.function)
byref = gfc_return_by_reference (sym->ns->proc_name);
}
/* Dummy variables should already have been created. */
- assert (sym->backend_decl);
+ gcc_assert (sym->backend_decl);
/* Create a character length variable. */
if (sym->ts.type == BT_CHARACTER)
SET_DECL_ASSEMBLER_NAME (decl, get_identifier (name));
}
gfc_finish_var_decl (length, sym);
- assert (!sym->value);
+ gcc_assert (!sym->value);
}
}
sym->backend_decl = decl;
/* 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
to know that. */
- assert (!(sym->attr.entry || sym->attr.entry_master));
+ gcc_assert (!(sym->attr.entry || sym->attr.entry_master));
if (sym->attr.intrinsic)
{
at the first argument. We pass NULL for the second argument
otherwise things like AINT get confused. */
isym = gfc_find_function (sym->name);
- assert (isym->resolve.f0 != NULL);
+ gcc_assert (isym->resolve.f0 != NULL);
memset (&e, 0, sizeof (e));
e.expr_type = EXPR_FUNCTION;
memset (&argexpr, 0, sizeof (argexpr));
- assert (isym->formal);
+ gcc_assert (isym->formal);
argexpr.ts = isym->formal->ts;
if (isym->formal->next == NULL)
else
{
/* 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);
}
sprintf (s, "specific%s", e.value.function.name);
tree result_decl;
gfc_formal_arglist *f;
- assert (!sym->backend_decl);
- assert (!sym->attr.external);
+ gcc_assert (!sym->backend_decl);
+ gcc_assert (!sym->attr.external);
/* Set the line and filename. sym->declared_at seems to point to the
last statement for subroutines, but it'll do for now. */
gfc_set_backend_locus (&sym->declared_at);
/* 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);
type = gfc_get_function_type (sym);
/* Length of character result. */
type = TREE_VALUE (typelist);
- assert (type == gfc_charlen_type_node);
+ gcc_assert (type == gfc_charlen_type_node);
length = build_decl (PARM_DECL,
get_identifier (".__result"),
sym->ts.cl->backend_decl = length;
TREE_USED (length) = 1;
}
- assert (TREE_CODE (length) == PARM_DECL);
+ gcc_assert (TREE_CODE (length) == PARM_DECL);
arglist = chainon (arglist, length);
typelist = TREE_CHAIN (typelist);
DECL_CONTEXT (length) = fndecl;
parm = f->sym->backend_decl;
type = TREE_VALUE (typelist);
- assert (type == gfc_charlen_type_node);
+ gcc_assert (type == gfc_charlen_type_node);
strcpy (&name[1], f->sym->name);
name[0] = '_';
typelist = TREE_CHAIN (typelist);
}
- assert (TREE_VALUE (typelist) == void_type_node);
+ gcc_assert (TREE_VALUE (typelist) == void_type_node);
DECL_ARGUMENTS (fndecl) = arglist;
}
locus old_loc;
/* 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);
for (el = ns->entries; el; el = el->next)
int n;
/* 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);
tree decl;
tree tmp;
- assert (sym->backend_decl);
- assert (sym->ts.cl && sym->ts.cl->length);
+ gcc_assert (sym->backend_decl);
+ gcc_assert (sym->ts.cl && sym->ts.cl->length);
gfc_start_block (&body);
case AS_ASSUMED_SIZE:
/* Must be a dummy parameter. */
- assert (sym->attr.dummy);
+ gcc_assert (sym->attr.dummy);
/* We should always pass assumed size arrays the g77 way. */
fnbody = gfc_trans_g77_array (sym, fnbody);
case AS_ASSUMED_SHAPE:
/* 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);
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
else if (sym->ts.type == BT_CHARACTER)
gfc_set_backend_locus (&loc);
}
else
- abort ();
+ gcc_unreachable ();
}
return fnbody;
module_namespace = ns;
/* 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. */
gfc_trans_common (ns);
sym = ns->proc_name;
/* Check that the frontend isn't still using this. */
- assert (sym->tlink == NULL);
+ gcc_assert (sym->tlink == NULL);
sym->tlink = sym;
/* Create the declaration for functions with global scope. */
void
gfc_generate_constructors (void)
{
- if (gfc_static_ctors != NULL_TREE)
- abort ();
+ gcc_assert (gfc_static_ctors == NULL_TREE);
#if 0
tree fnname;
tree type;
#include "tree-gimple.h"
#include "flags.h"
#include <gmp.h>
-#include <assert.h>
#include "gfortran.h"
#include "trans.h"
#include "trans-const.h"
{
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;
/* Walk down the parent chain. */
while (p != NULL)
{
/* 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;
{
tree decl;
- assert (sym->attr.dummy && sym->attr.optional);
+ gcc_assert (sym->attr.dummy && sym->attr.optional);
decl = gfc_get_symbol_decl (sym);
if (TREE_CODE (decl) != PARM_DECL)
{
/* Array parameters use a temporary descriptor, we want the real
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)));
decl = GFC_DECL_SAVED_DESCRIPTOR (decl);
}
c = ref->u.c.component;
- assert (c->backend_decl);
+ gcc_assert (c->backend_decl);
field = c->backend_decl;
- assert (TREE_CODE (field) == FIELD_DECL);
+ gcc_assert (TREE_CODE (field) == FIELD_DECL);
decl = se->expr;
tmp = build3 (COMPONENT_REF, TREE_TYPE (field), decl, field, NULL_TREE);
{
tmp = c->ts.cl->backend_decl;
/* Components must always be constant length. */
- assert (tmp && INTEGER_CST_P (tmp));
+ gcc_assert (tmp && INTEGER_CST_P (tmp));
se->string_length = tmp;
}
if (se->ss != NULL)
{
/* Check that something hasn't gone horribly wrong. */
- assert (se->ss != gfc_ss_terminator);
- assert (se->ss->expr == expr);
+ gcc_assert (se->ss != gfc_ss_terminator);
+ gcc_assert (se->ss->expr == expr);
/* A scalarized term. We already know the descriptor. */
se->expr = se->ss->data.info.descriptor;
if (sym->attr.flavor == FL_PROCEDURE
&& se->expr != current_function_decl)
{
- assert (se->want_pointer);
+ gcc_assert (se->want_pointer);
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);
}
return;
if (sym->ts.type == BT_CHARACTER)
{
se->string_length = sym->ts.cl->backend_decl;
- assert (se->string_length);
+ gcc_assert (se->string_length);
}
while (ref)
break;
default:
- abort ();
+ gcc_unreachable ();
break;
}
ref = ref->next;
gfc_se operand;
tree type;
- assert (expr->ts.type != BT_CHARACTER);
+ gcc_assert (expr->ts.type != BT_CHARACTER);
/* Initialize the operand. */
gfc_init_se (&operand, se);
gfc_conv_expr_val (&operand, expr->op1);
break;
default:
- abort();
+ gcc_unreachable ();
}
switch (kind)
{
if (expr->op1->ts.type == BT_INTEGER)
lse.expr = convert (gfc_int4_type_node, lse.expr);
else
- abort ();
+ gcc_unreachable ();
/* Fall through. */
case 4:
break;
default:
- abort();
+ gcc_unreachable ();
}
switch (expr->op1->ts.type)
break;
default:
- abort ();
+ gcc_unreachable ();
}
break;
fndecl = built_in_decls[BUILT_IN_POW];
break;
default:
- abort ();
+ gcc_unreachable ();
}
break;
fndecl = gfor_fndecl_math_cpow;
break;
default:
- abort ();
+ gcc_unreachable ();
}
break;
default:
- abort ();
+ gcc_unreachable ();
break;
}
tree tmp;
tree args;
- if (TREE_TYPE (len) != gfc_charlen_type_node)
- abort ();
+ gcc_assert (TREE_TYPE (len) == gfc_charlen_type_node);
if (gfc_can_put_var_on_stack (len))
{
tree args;
tree tmp;
- assert (expr->op1->ts.type == BT_CHARACTER
+ gcc_assert (expr->op1->ts.type == BT_CHARACTER
&& expr->op2->ts.type == BT_CHARACTER);
gfc_init_se (&lse, se);
case INTRINSIC_USER:
case INTRINSIC_ASSIGN:
/* These should be converted into function calls by the frontend. */
- abort ();
- return;
+ gcc_unreachable ();
default:
fatal_error ("Unknown intrinsic op");
}
/* 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)
checkstring = 0;
if (sym->attr.dummy)
{
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);
se->expr = tmp;
sym->backend_decl = gfc_get_extern_function_decl (sym);
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);
}
}
{
if (!sym->attr.elemental)
{
- assert (se->ss->type == GFC_SS_FUNCTION);
+ gcc_assert (se->ss->type == GFC_SS_FUNCTION);
if (se->ss->useflags)
{
- assert (gfc_return_by_reference (sym)
+ gcc_assert (gfc_return_by_reference (sym)
&& sym->result->attr.dimension);
- assert (se->loop != NULL);
+ gcc_assert (se->loop != NULL);
/* Access the previously obtained result. */
gfc_conv_tmp_array_ref (se);
arglist = gfc_chainon_list (arglist, se->expr);
else if (sym->result->attr.dimension)
{
- assert (se->loop && se->ss);
+ gcc_assert (se->loop && se->ss);
/* Set the type of the array. */
tmp = gfc_typenode_for_spec (&sym->ts);
info->dimen = se->loop->dimen;
}
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);
len = gfc_conv_mpz_to_tree
(sym->ts.cl->length->value.integer, sym->ts.cl->length->ts.kind);
convert (gfc_charlen_type_node, len));
}
else /* TODO: derived type function return values. */
- abort ();
+ gcc_unreachable ();
}
formal = sym->formal;
se->string_length = len;
}
else
- abort ();
+ gcc_unreachable ();
}
}
}
{
/* Each dummy shall be specified, explicitly or implicitly, to be
scalar. */
- assert (fargs->sym->attr.dimension == 0);
+ gcc_assert (fargs->sym->attr.dimension == 0);
fsym = fargs->sym;
/* Create a temporary to hold the value. */
/* Copy string arguments. */
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);
arglen = TYPE_MAX_VALUE (TYPE_DOMAIN (type));
static void
gfc_conv_array_constructor_expr (gfc_se * se, gfc_expr * expr)
{
- assert (se->ss != NULL && se->ss != gfc_ss_terminator);
- assert (se->ss->expr == expr && se->ss->type == GFC_SS_CONSTRUCTOR);
+ gcc_assert (se->ss != NULL && se->ss != gfc_ss_terminator);
+ gcc_assert (se->ss->expr == expr && se->ss->type == GFC_SS_CONSTRUCTOR);
gfc_conv_tmp_array_ref (se);
gfc_advance_se_ss_chain (se);
tmp = gfc_trans_scalar_assign (&lse, &rse, cm->ts.type);
gfc_add_expr_to_block (&body, tmp);
- if (rse.ss != gfc_ss_terminator)
- abort ();
+ gcc_assert (rse.ss == gfc_ss_terminator);
/* Generate the copying loops. */
gfc_trans_scalarizing_loops (&loop, &body);
tree type;
tree tmp;
- assert (se->ss == NULL);
- assert (expr->expr_type == EXPR_STRUCTURE);
+ gcc_assert (se->ss == NULL);
+ gcc_assert (expr->expr_type == EXPR_STRUCTURE);
type = gfc_typenode_for_spec (&expr->ts);
if (!init)
ref = expr->ref;
- assert(ref->type == REF_SUBSTRING);
+ gcc_assert (ref->type == REF_SUBSTRING);
se->expr = gfc_build_string_const(expr->value.character.length,
expr->value.character.string);
break;
default:
- abort ();
+ gcc_unreachable ();
break;
}
}
gfc_conv_expr (se, expr);
/* 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. */
- assert (expr->ts.type != BT_CHARACTER || !se->post.head);
+ gcc_assert (expr->ts.type != BT_CHARACTER || !se->post.head);
}
void
{
tree val;
- assert (expr->ts.type != BT_CHARACTER);
+ gcc_assert (expr->ts.type != BT_CHARACTER);
gfc_conv_expr (se, expr);
if (se->post.head)
{
/* Scalar pointers. */
lse.want_pointer = 1;
gfc_conv_expr (&lse, expr1);
- assert (rss == gfc_ss_terminator);
+ gcc_assert (rss == gfc_ss_terminator);
gfc_init_se (&rse, NULL);
rse.want_pointer = 1;
gfc_conv_expr (&rse, expr2);
type = TREE_TYPE (se->expr);
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);
}
- assert (POINTER_TYPE_P (TREE_TYPE (se->expr)));
- assert (se->string_length
+ gcc_assert (POINTER_TYPE_P (TREE_TYPE (se->expr)));
+ gcc_assert (se->string_length
&& TREE_CODE (TREE_TYPE (se->string_length)) == INTEGER_TYPE);
}
if (type == BT_CHARACTER)
{
- assert (lse->string_length != NULL_TREE
+ gcc_assert (lse->string_length != NULL_TREE
&& rse->string_length != NULL_TREE);
gfc_conv_string_parameter (lse);
/* The frontend doesn't seem to bother filling in expr->symtree for intrinsic
functions. */
- assert (expr2->value.function.isym
+ gcc_assert (expr2->value.function.isym
|| (gfc_return_by_reference (expr2->symtree->n.sym)
&& expr2->symtree->n.sym->result->attr.dimension));
ss = gfc_walk_expr (expr1);
- assert (ss != gfc_ss_terminator);
+ gcc_assert (ss != gfc_ss_terminator);
gfc_init_se (&se, NULL);
gfc_start_block (&se.pre);
se.want_pointer = 1;
se.direct_byref = 1;
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_add_block_to_block (&se.pre, &se.post);
&& lss_section->type != GFC_SS_SECTION)
lss_section = lss_section->next;
- assert (lss_section != gfc_ss_terminator);
+ gcc_assert (lss_section != gfc_ss_terminator);
/* Initialize the scalarizer. */
gfc_init_loopinfo (&loop);
}
else
{
- if (lse.ss != gfc_ss_terminator)
- abort ();
- if (rse.ss != gfc_ss_terminator)
- abort ();
+ gcc_assert (lse.ss == gfc_ss_terminator
+ && rse.ss == gfc_ss_terminator);
if (loop.temp_ss != NULL)
{
gfc_advance_se_ss_chain (&rse);
gfc_conv_expr (&lse, expr1);
- if (lse.ss != gfc_ss_terminator)
- abort ();
-
- if (rse.ss != gfc_ss_terminator)
- abort ();
+ gcc_assert (lse.ss == gfc_ss_terminator
+ && rse.ss == gfc_ss_terminator);
tmp = gfc_trans_scalar_assign (&lse, &rse, expr1->ts.type);
gfc_add_expr_to_block (&body, tmp);
#include "real.h"
#include "tree-gimple.h"
#include "flags.h"
-#include <assert.h>
#include "gfortran.h"
#include "arith.h"
#include "intrinsic.h"
/* Evaluate the argument. */
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 = TREE_VALUE (arg);
}
/* Evaluate the argument. */
- assert (expr->value.function.actual->expr);
+ gcc_assert (expr->value.function.actual->expr);
arg = gfc_conv_intrinsic_function_args (se, expr);
/* Use a builtin function if one exists. */
/* Evaluate the argument. */
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 = TREE_VALUE (arg);
pdecl = &m->real8_decl;
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
else if (ts->type == BT_COMPLEX)
{
- if (!m->complex_available)
- abort ();
+ gcc_assert (m->complex_available);
switch (ts->kind)
{
pdecl = &m->complex8_decl;
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
else
- abort ();
+ gcc_unreachable ();
if (*pdecl)
return *pdecl;
if (m->libm_name)
{
- if (ts->kind != 4 && ts->kind != 8)
- abort ();
+ gcc_assert (ts->kind == 4 || ts->kind == 8);
snprintf (name, sizeof (name), "%s%s%s",
ts->type == BT_COMPLEX ? "c" : "",
m->name,
fndecl = gfor_fndecl_math_exponent8;
break;
default:
- abort ();
+ gcc_unreachable ();
}
se->expr = gfc_build_function_call (fndecl, args);
if (se->ss)
{
/* Create an implicit second parameter from the loop variable. */
- assert (!arg2->expr);
- assert (se->loop->dimen == 1);
- assert (se->ss->expr == expr);
+ gcc_assert (!arg2->expr);
+ gcc_assert (se->loop->dimen == 1);
+ gcc_assert (se->ss->expr == expr);
gfc_advance_se_ss_chain (se);
bound = se->loop->loopvar[0];
bound = fold (build2 (MINUS_EXPR, gfc_array_index_type, bound,
else
{
/* use the passed argument. */
- assert (arg->next->expr);
+ gcc_assert (arg->next->expr);
gfc_init_se (&argse, NULL);
gfc_conv_expr_type (&argse, arg->next->expr, gfc_array_index_type);
gfc_add_block_to_block (&se->pre, &argse.pre);
/* TODO: don't re-evaluate the descriptor on each iteration. */
/* Get a descriptor for the first parameter. */
ss = gfc_walk_expr (arg->expr);
- assert (ss != gfc_ss_terminator);
+ gcc_assert (ss != gfc_ss_terminator);
argse.want_pointer = 0;
gfc_conv_expr_descriptor (&argse, arg->expr, ss);
gfc_add_block_to_block (&se->pre, &argse.pre);
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);
- assert (i >= 0 && i < GFC_TYPE_ARRAY_RANK (TREE_TYPE (desc)));
+ gcc_assert (i >= 0 && i < GFC_TYPE_ARRAY_RANK (TREE_TYPE (desc)));
}
else
{
int n;
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);
switch (expr->value.function.actual->expr->ts.type)
n = BUILT_IN_CABS;
break;
default:
- abort ();
+ gcc_unreachable ();
}
se->expr = fold (gfc_build_function_call (built_in_decls[n], args));
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
break;
default:
- abort ();
+ gcc_unreachable ();
}
if (modulo)
tmp = built_in_decls[BUILT_IN_COPYSIGN];
break;
default:
- abort ();
+ gcc_unreachable ();
}
se->expr = fold (gfc_build_function_call (tmp, arg));
return;
gfc_expr *arg;
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 = convert (gfc_typenode_for_spec (&expr->ts), se->expr);
}
arg = TREE_VALUE (arg);
/* We currently don't support character types != 1. */
- assert (expr->ts.kind == 1);
+ gcc_assert (expr->ts.kind == 1);
type = gfc_character1_type_node;
var = gfc_create_var (type, "char");
gfc_symbol *sym;
/* 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->ts = expr->ts;
{
gfc_symbol *sym;
- assert (!se->ss || se->ss->expr == expr);
+ gcc_assert (!se->ss || se->ss->expr == expr);
if (se->ss)
- assert (expr->rank > 0);
+ gcc_assert (expr->rank > 0);
else
- assert (expr->rank == 0);
+ gcc_assert (expr->rank == 0);
sym = gfc_get_symbol_for_expr (expr);
gfc_conv_function_call (se, sym, expr->value.function.actual);
/* Walk the arguments. */
arrayss = gfc_walk_expr (actual->expr);
- assert (arrayss != gfc_ss_terminator);
+ gcc_assert (arrayss != gfc_ss_terminator);
/* Initialize the scalarizer. */
gfc_init_loopinfo (&loop);
/* Walk the arguments. */
arrayss = gfc_walk_expr (actual->expr);
- assert (arrayss != gfc_ss_terminator);
+ gcc_assert (arrayss != gfc_ss_terminator);
/* Initialize the scalarizer. */
gfc_init_loopinfo (&loop);
actual = expr->value.function.actual;
arrayexpr = actual->expr;
arrayss = gfc_walk_expr (arrayexpr);
- assert (arrayss != gfc_ss_terminator);
+ gcc_assert (arrayss != gfc_ss_terminator);
actual = actual->next->next;
- assert (actual);
+ gcc_assert (actual);
maskexpr = actual->expr;
if (maskexpr)
{
maskss = gfc_walk_expr (maskexpr);
- assert (maskss != gfc_ss_terminator);
+ gcc_assert (maskss != gfc_ss_terminator);
}
else
maskss = NULL;
actual = expr->value.function.actual;
arrayexpr = actual->expr;
arrayss = gfc_walk_expr (arrayexpr);
- assert (arrayss != gfc_ss_terminator);
+ gcc_assert (arrayss != gfc_ss_terminator);
actual = actual->next->next;
- assert (actual);
+ gcc_assert (actual);
maskexpr = actual->expr;
if (maskexpr)
{
maskss = gfc_walk_expr (maskexpr);
- assert (maskss != gfc_ss_terminator);
+ gcc_assert (maskss != gfc_ss_terminator);
}
else
maskss = NULL;
break;
default:
- abort ();
+ gcc_unreachable ();
}
/* Most negative(+HUGE) for maxval, most negative (-HUGE) for minval. */
gfc_conv_ss_startstride (&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
size we need to return zero. Otherwise use the first element of the
break;
default:
- abort ();
+ gcc_unreachable ();
}
/* Most negative(-HUGE) for maxval, most positive (-HUGE) for minval. */
actual = expr->value.function.actual;
arrayexpr = actual->expr;
arrayss = gfc_walk_expr (arrayexpr);
- assert (arrayss != gfc_ss_terminator);
+ gcc_assert (arrayss != gfc_ss_terminator);
actual = actual->next->next;
- assert (actual);
+ gcc_assert (actual);
maskexpr = actual->expr;
if (maskexpr)
{
maskss = gfc_walk_expr (maskexpr);
- assert (maskss != gfc_ss_terminator);
+ gcc_assert (maskss != gfc_ss_terminator);
}
else
maskss = NULL;
tmp = gfor_fndecl_math_ishftc8;
break;
default:
- abort ();
+ gcc_unreachable ();
}
se->expr = gfc_build_function_call (tmp, arg);
return;
gfc_se argse;
gfc_expr *arg;
- assert (!se->ss);
+ gcc_assert (!se->ss);
arg = expr->value.function.actual->expr;
decl = gfc_get_fake_result_decl (sym);
len = sym->ts.cl->backend_decl;
- assert (len);
+ gcc_assert (len);
}
else
{
arg = gfc_conv_intrinsic_function_args (se, expr);
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);
type = gfc_typenode_for_spec (&expr->ts);
actual = expr->value.function.actual;
ss = gfc_walk_expr (actual->expr);
- assert (ss != gfc_ss_terminator);
+ gcc_assert (ss != gfc_ss_terminator);
argse.want_pointer = 1;
gfc_conv_expr_descriptor (&argse, actual->expr, ss);
gfc_add_block_to_block (&se->pre, &argse.pre);
tree ptr;
gfc_ss *ss;
- assert (!se->ss);
+ gcc_assert (!se->ss);
/* Get a pointer to the source. */
arg = expr->value.function.actual;
if (ss1 == gfc_ss_terminator)
{
/* A pointer to a scalar. */
- assert (ss2 == gfc_ss_terminator);
+ gcc_assert (ss2 == gfc_ss_terminator);
arg1se.want_pointer = 1;
gfc_conv_expr (&arg1se, arg1->expr);
arg2se.want_pointer = 1;
else
{
/* A pointer to an array, call library function _gfor_associated. */
- assert (ss2 != gfc_ss_terminator);
+ gcc_assert (ss2 != gfc_ss_terminator);
args = NULL_TREE;
arg1se.want_pointer = 1;
gfc_conv_expr_descriptor (&arg1se, arg1->expr, ss1);
if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_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 = TREE_VALUE (arg);
else if (op0_mode == TYPE_MODE (long_long_integer_type_node))
fn = built_in_decls[BUILT_IN_CLZLL];
else
- abort ();
+ gcc_unreachable ();
parms = tree_cons (NULL, op0, NULL);
call = gfc_build_function_call (fn, parms);
switch (expr->value.function.isym->generic_id)
{
case GFC_ISYM_NONE:
- abort ();
+ gcc_unreachable ();
case GFC_ISYM_REPEAT:
gfc_conv_intrinsic_repeat (se, expr);
break;
default:
- abort ();
- break;
+ gcc_unreachable ();
}
}
{
gfc_ss *newss;
- assert (expr->rank > 0);
+ gcc_assert (expr->rank > 0);
newss = gfc_get_ss ();
newss->type = GFC_SS_FUNCTION;
int
gfc_is_intrinsic_libcall (gfc_expr * expr)
{
- assert (expr->expr_type == EXPR_FUNCTION && expr->value.function.isym);
- assert (expr->rank > 0);
+ gcc_assert (expr->expr_type == EXPR_FUNCTION && expr->value.function.isym);
+ gcc_assert (expr->rank > 0);
switch (expr->value.function.isym->generic_id)
{
gfc_walk_intrinsic_function (gfc_ss * ss, gfc_expr * expr,
gfc_intrinsic_sym * isym)
{
- assert (isym);
+ gcc_assert (isym);
if (isym->elemental)
return gfc_walk_elemental_function_args (ss, expr, GFC_SS_SCALAR);
#include "ggc.h"
#include "toplev.h"
#include "real.h"
-#include <assert.h>
#include <gmp.h>
#include "gfortran.h"
#include "trans.h"
tree tmp, args, arg2;
tree expr;
- assert (POINTER_TYPE_P (TREE_TYPE (addr_expr)));
+ gcc_assert (POINTER_TYPE_P (TREE_TYPE (addr_expr)));
if (ts->type == BT_DERIVED)
{
for (c = ts->derived->components; c; c = c->next)
{
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),
expr, field, NULL_TREE);
case BT_CHARACTER:
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,
TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (expr))));
tmp = gfc_build_function_call (iocall_set_nml_val_char, args);
set_error_locus (&block, &code->loc);
dt = code->ext.dt;
- assert (dt != NULL);
+ gcc_assert (dt != NULL);
if (dt->io_unit)
{
inq = code->ext.inquire;
/* First check that preconditions are met. */
- assert(inq != NULL);
- assert(inq->iolength != NULL);
+ gcc_assert (inq != NULL);
+ gcc_assert (inq->iolength != NULL);
/* Connect to the iolength variable. */
if (inq->iolength)
break;
default:
- abort ();
+ gcc_unreachable ();
}
tmp = gfc_build_function_call (function, NULL);
if (last_dt != IOLENGTH)
{
- assert(code->ext.dt != NULL);
+ gcc_assert (code->ext.dt != NULL);
io_result (&block, code->ext.dt->err,
code->ext.dt->end, code->ext.dt->eor);
}
for (c = ts->derived->components; c; c = c->next)
{
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,
NULL_TREE);
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 =
TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (tmp)));
}
tmp = gfc_finish_block (&body);
else
{
- assert (se.ss == gfc_ss_terminator);
+ gcc_assert (se.ss == gfc_ss_terminator);
gfc_trans_scalarizing_loops (&loop, &body);
gfc_add_block_to_block (&loop.pre, &loop.post);
#include "ggc.h"
#include "toplev.h"
#include "real.h"
-#include <assert.h>
#include <gmp.h>
#include "gfortran.h"
#include "trans.h"
gfc_init_se (&se, NULL);
gfc_start_block (&se.pre);
- assert (code->resolved_sym);
+ gcc_assert (code->resolved_sym);
has_alternate_specifier = 0;
/* Translate the call. */
gfc_code *select_code;
gfc_symbol *sym;
select_code = code->next;
- assert(select_code->op == EXEC_SELECT);
+ gcc_assert(select_code->op == EXEC_SELECT);
sym = select_code->expr->symtree->n.sym;
se.expr = convert (gfc_typenode_for_spec (&sym->ts), se.expr);
gfc_add_modify_expr (&se.pre, sym->backend_decl, se.expr);
tree
gfc_trans_select (gfc_code * code)
{
- assert (code && code->expr);
+ gcc_assert (code && code->expr);
/* Empty SELECT constructs are legal. */
if (code->block == NULL)
type = build_array_type (elem_type, type);
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");
*pdata = NULL_TREE;
}
else if (gfc_index_integer_kind == 8)
tmp = gfor_fndecl_internal_malloc64;
else
- abort ();
+ gcc_unreachable ();
tmp = gfc_build_function_call (tmp, args);
tmp = convert (TREE_TYPE (tmpvar), tmp);
gfc_add_modify_expr (pblock, tmpvar, tmp);
break;
default:
- abort ();
- break;
+ gcc_unreachable ();
}
c = c->next;
/* In each where-assign-stmt, the mask-expr and the variable being
defined shall be arrays of the same shape. */
- assert (lss != gfc_ss_terminator);
+ gcc_assert (lss != gfc_ss_terminator);
/* The assignment needs scalarization. */
lss_section = lss;
&& lss_section->type != GFC_SS_SECTION)
lss_section = lss_section->next;
- assert (lss_section != gfc_ss_terminator);
+ gcc_assert (lss_section != gfc_ss_terminator);
/* Initialize the scalarizer. */
gfc_init_loopinfo (&loop);
}
else
{
- if (lse.ss != gfc_ss_terminator)
- abort ();
- if (rse.ss != gfc_ss_terminator)
- abort ();
+ gcc_assert (lse.ss == gfc_ss_terminator
+ && rse.ss == gfc_ss_terminator);
if (loop.temp_ss != NULL)
{
gfc_advance_se_ss_chain (&rse);
gfc_conv_expr (&lse, expr1);
- if (lse.ss != gfc_ss_terminator)
- abort ();
-
- if (rse.ss != gfc_ss_terminator)
- abort ();
+ gcc_assert (lse.ss == gfc_ss_terminator
+ && rse.ss == gfc_ss_terminator);
/* Form the mask expression according to the mask tree list. */
index = count2;
break;
default:
- abort ();
+ gcc_unreachable ();
}
/* The next statement within the same where-body-construct. */
/* Find the last reference in the chain. */
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;
}
for (al = code->ext.alloc_list; al != NULL; al = al->next)
{
expr = al->expr;
- assert (expr->expr_type == EXPR_VARIABLE);
+ gcc_assert (expr->expr_type == EXPR_VARIABLE);
gfc_init_se (&se, NULL);
gfc_start_block (&se.pre);
#include "trans-types.h"
#include "trans-const.h"
#include "real.h"
-#include <assert.h>
\f
#if (GFC_MAX_DIMENSIONS < 10)
if (bitsize > 2*HOST_BITS_PER_WIDE_INT)
continue;
- if (i_index == MAX_INT_KINDS)
- abort ();
+ gcc_assert (i_index != MAX_INT_KINDS);
/* Let the kind equal the bit size divided by 8. This insulates the
programmer from the underlying byte size. */
saw_r16 = true;
/* Careful we don't stumble a wierd internal mode. */
- if (r_index > 0 && gfc_real_kinds[r_index-1].kind == kind)
- abort ();
+ gcc_assert (r_index <= 0 || gfc_real_kinds[r_index-1].kind != kind);
/* Or have too many modes for the allocated space. */
- if (r_index == MAX_REAL_KINDS)
- abort ();
+ gcc_assert (r_index != MAX_REAL_KINDS);
gfc_real_kinds[r_index].kind = kind;
gfc_real_kinds[r_index].radix = fmt->b;
return LONG_TYPE_SIZE;
if (strcmp (SIZE_TYPE, "short unsigned int") == 0)
return SHORT_TYPE_SIZE;
- abort ();
+ gcc_unreachable ();
#else
return LONG_TYPE_SIZE;
#endif
switch (spec->type)
{
case BT_UNKNOWN:
- abort ();
- break;
+ gcc_unreachable ();
case BT_INTEGER:
basetype = gfc_get_int_type (spec->kind);
break;
default:
- abort ();
- break;
+ gcc_unreachable ();
}
return basetype;
}
{
if (TREE_CODE (type) == POINTER_TYPE)
type = TREE_TYPE (type);
- assert (TREE_CODE (type) == ARRAY_TYPE);
+ gcc_assert (TREE_CODE (type) == ARRAY_TYPE);
element = TREE_TYPE (type);
}
else
{
- assert (GFC_DESCRIPTOR_TYPE_P (type));
+ gcc_assert (GFC_DESCRIPTOR_TYPE_P (type));
element = TREE_TYPE (TYPE_FIELDS (type));
- assert (TREE_CODE (element) == POINTER_TYPE);
+ gcc_assert (TREE_CODE (element) == POINTER_TYPE);
element = TREE_TYPE (element);
- assert (TREE_CODE (element) == ARRAY_TYPE);
+ gcc_assert (TREE_CODE (element) == ARRAY_TYPE);
element = TREE_TYPE (element);
}
int
gfc_is_nodesc_array (gfc_symbol * sym)
{
- assert (sym->attr.dimension);
+ gcc_assert (sym->attr.dimension);
/* We only want local arrays. */
if (sym->attr.pointer || sym->attr.allocatable)
if (sym->attr.pointer || sym->attr.allocatable)
return 0;
- assert (sym->as->type == AS_EXPLICIT);
+ gcc_assert (sym->as->type == AS_EXPLICIT);
return 1;
}
return gfc_index_zero_node;
}
- assert (rank <= GFC_DTYPE_RANK_MASK);
+ gcc_assert (rank <= GFC_DTYPE_RANK_MASK);
size = TYPE_SIZE_UNIT (type);
i = rank | (n << GFC_DTYPE_TYPE_SHIFT);
stride =
fold (build2 (MULT_EXPR, gfc_array_index_type, tmp, stride));
/* Check the folding worked. */
- assert (INTEGER_CST_P (stride));
+ gcc_assert (INTEGER_CST_P (stride));
}
else
stride = NULL_TREE;
tree typenode, field, field_type, fieldlist;
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
components' backend_decl may have not been built. */
{
/* Evaluate the string length. */
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);
DECL_PACKED (field) |= TYPE_PACKED (typenode);
- assert (!c->backend_decl);
+ gcc_assert (!c->backend_decl);
c->backend_decl = field;
}
if (!sym->attr.function)
return 0;
- assert (sym->attr.function);
+ gcc_assert (sym->attr.function);
if (sym->result)
sym = sym->result;
int alternate_return;
/* 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)
return TREE_TYPE (sym->backend_decl);
#include "defaults.h"
#include "real.h"
#include <gmp.h>
-#include <assert.h>
#include "gfortran.h"
#include "trans.h"
#include "trans-stmt.h"
{
for (; n > 0; n--)
{
- assert (t != NULL_TREE);
+ gcc_assert (t != NULL_TREE);
t = TREE_CHAIN (t);
}
return t;
for scalar assignments. We should probably have something
similar for aggregates, but right now removing that check just
breaks everything. */
- if (TREE_TYPE (rhs) != TREE_TYPE (lhs)
- && !AGGREGATE_TYPE_P (TREE_TYPE (lhs)))
- abort ();
+ gcc_assert (TREE_TYPE (rhs) == TREE_TYPE (lhs)
+ || AGGREGATE_TYPE_P (TREE_TYPE (lhs)));
#endif
tmp = fold (build2_v (MODIFY_EXPR, lhs, rhs));
tree decl;
tree next;
- assert (block->has_scope);
+ gcc_assert (block->has_scope);
block->has_scope = 0;
/* Remember the decls in this scope. */
gfc_build_indirect_ref (tree t)
{
tree type = TREE_TYPE (t);
- if (!POINTER_TYPE_P (type))
- abort ();
+ gcc_assert (POINTER_TYPE_P (type));
type = TREE_TYPE (type);
if (TREE_CODE (t) == ADDR_EXPR)
gfc_build_array_ref (tree base, tree offset)
{
tree type = TREE_TYPE (base);
- if (TREE_CODE (type) != ARRAY_TYPE)
- abort ();
+ gcc_assert (TREE_CODE (type) == ARRAY_TYPE);
type = TREE_TYPE (type);
if (DECL_P (base))
/* The code to generate the error. */
gfc_start_block (&block);
- assert (TREE_CODE (msg) == STRING_CST);
+ gcc_assert (TREE_CODE (msg) == STRING_CST);
TREE_USED (msg) = 1;
void
gfc_add_expr_to_block (stmtblock_t * block, tree expr)
{
- assert (block);
+ gcc_assert (block);
if (expr == NULL_TREE || IS_EMPTY_STMT (expr))
return;
void
gfc_add_block_to_block (stmtblock_t * block, stmtblock_t * append)
{
- assert (append);
- assert (!append->has_scope);
+ gcc_assert (append);
+ gcc_assert (!append->has_scope);
gfc_add_expr_to_block (block, append->head);
append->head = NULL_TREE;