+2004-09-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ * array.c, data.c, decl.c, dependency.c, error.c, f95-lang.c,
+ interface.c, intrinsic.c, io.c, misc.c, module.c, parse.h,
+ resolve.c, scanner.c, trans-array.c, trans-array.h,
+ trans-common.c, trans-const.h, trans-decl.c, trans-expr.c,
+ trans-intrinsic.c, trans-stmt.c, trans-types.c, trans.c,
+ trans.h: Fix comment typos. Follow spelling conventions.
+
2004-09-16 Victor Leikehman <lei@il.ibm.com>
PR/15364
{
if (cons_state == CONS_BAD)
- return 0; /* Supress further errors */
+ return 0; /* Suppress further errors */
if (cons_state == CONS_START)
{
/********* Subroutines for determining the size of an array *********/
-/* These are needed just to accomodate RESHAPE(). There are no
+/* These are needed just to accommodate RESHAPE(). There are no
diagnostics here, we just return a negative number if something
goes wrong. */
/* Rearrange a structure constructor so the elements are in the specified
- order. Also insert NULL entries if neccessary. */
+ order. Also insert NULL entries if necessary. */
static void
formalize_structure_cons (gfc_expr * expr)
}
-/* Return nonzero if we're currenly compiling a contained procedure. */
+/* Return nonzero if we're currently compiling a contained procedure. */
static int
contained_procedure (void)
return 1;
case EXPR_FUNCTION:
- /* Remember possible differences betweeen elemental and
+ /* Remember possible differences between elemental and
transformational functions. All functions inside a FORALL
will be pure. */
for (actual = expr2->value.function.actual;
}
-/* Report the number of warnings and errors that occured to the caller. */
+/* Report the number of warnings and errors that occurred to the caller. */
void
gfc_get_errors (int *w, int *e)
tree
poplevel (int keep, int reverse, int functionbody)
{
- /* Points to a BLOCK tree node. This is the BLOCK node construted for the
+ /* Points to a BLOCK tree node. This is the BLOCK node constructed for the
binding level that we are about to exit and which is returned by this
routine. */
tree block_node = NULL_TREE;
/* Reverse the list of XXXX_DECL nodes if desired. Note that the ..._DECL
nodes chained through the `names' field of current_binding_level are in
- reverse order except for PARM_DECL node, which are explicitely stored in
+ reverse order except for PARM_DECL node, which are explicitly stored in
the right order. */
decl_chain = (reverse) ? nreverse (current_binding_level->names)
: current_binding_level->names;
int ggc_p = 1;
-/* Builtin function initialisation. */
+/* Builtin function initialization. */
/* Return a definition for a builtin function named NAME and whose data type
is TYPE. TYPE should be a function type with argument types.
}
-/* Initialisation of builtin function nodes. */
+/* Initialization of builtin function nodes. */
static void
gfc_init_builtin_functions (void)
/* This subroutine is called when an expression is being resolved.
The expression node in question is either a user defined operator
- or an instrinsic operator with arguments that aren't compatible
+ or an intrinsic operator with arguments that aren't compatible
with the operator. This subroutine builds an actual argument list
corresponding to the operands, then searches for a compatible
interface. If one is found, the expression node is replaced with
#include "intrinsic.h"
-/* Nanespace to hold the resolved symbols for intrinsic subroutines. */
+/* Namespace to hold the resolved symbols for intrinsic subroutines. */
static gfc_namespace *gfc_intrinsic_namespace;
int gfc_init_expr = 0;
if (gfc_reference_st_label (dt->eor, ST_LABEL_TARGET) == FAILURE)
return FAILURE;
- /* Check the format label ectually exists. */
+ /* Check the format label actually exists. */
if (dt->format_label && dt->format_label != &format_asterisk
&& dt->format_label->defined == ST_LABEL_UNKNOWN)
{
}
-/* Return a string descibing the type and kind of a typespec. Because
+/* Return a string describing the type and kind of a typespec. Because
we return alternating buffers, this subroutine can appear twice in
the argument list of a single statement. */
#define MODULE_EXTENSION ".mod"
-/* Structure that descibes a position within a module file */
+/* Structure that describes a position within a module file */
typedef struct
{
gfc_ref structure), find the corresponding array specification
structure. Storing the pointer in the ref structure doesn't quite
work when loading from a module. Generating code for an array
- reference also needs more infomation than just the array spec. */
+ reference also needs more information than just the array spec. */
static const mstring array_ref_types[] = {
minit ("FULL", AR_FULL),
/* Parser header
- Copyright (C) 2003 Free Software Foundaton, Inc.
+ Copyright (C) 2003 Free Software Foundation, Inc.
Contributed by Steven Bosscher
This file is part of GCC.
because they are illegal and we never even try to generate code.
We have the additional caveat that a SELECT construct could have
- been a computed GOTO in the source code. Furtunately we can fairly
+ been a computed GOTO in the source code. Fortunately we can fairly
easily work around that here: The case_expr for a "real" SELECT CASE
is in code->expr1, but for a computed GOTO it is in code->expr2. All
we have to do is make sure that the case_expr is a scalar integer
}
gcc_assert (ref);
- /* Set marks asscording to the reference pattern. */
+ /* Set marks according to the reference pattern. */
switch (ref->u.ar.type)
{
case AR_FULL:
static int buflen = 0;
char *buffer;
- /* Detemine the maximum allowed line length. */
+ /* Determine the maximum allowed line length. */
if (gfc_current_form == FORM_FREE)
maxlen = GFC_MAX_LINE;
else
}
if (gfc_current_form == FORM_FIXED && c == '\t' && i <= 6)
- { /* Tab expandsion. */
+ { /* Tab expansion. */
while (i <= 6)
{
*buffer++ = ' ';
The scalar gfc_conv_* functions are then used to build the main body of the
scalarization loop. Scalarization loop variables and precalculated scalar
- values are automaticaly substituted. Note that gfc_advance_se_ss_chain
+ values are automatically substituted. Note that gfc_advance_se_ss_chain
must be used, rather than changing the se->ss directly.
For assignment expressions requiring a temporary two sub loops are
}
-/* Initialise a gfc_loopinfo structure. */
+/* Initialize a gfc_loopinfo structure. */
void
gfc_init_loopinfo (gfc_loopinfo * loop)
/* Calculate the offsets from all the dimensions. */
for (n = 0; n < ar->dimen; n++)
{
- /* Calculate the index for this demension. */
+ /* Calculate the index for this dimension. */
gfc_init_se (&indexse, NULL);
gfc_conv_expr_type (&indexse, ar->start[n], gfc_array_index_type);
gfc_add_block_to_block (&se->pre, &indexse.pre);
}
-/* Initialise the scalarization loop. Creates the loop variables. Determines
+/* Initialize the scalarization loop. Creates the loop variables. Determines
the range of the loop variables. Creates a temporary if required.
Calculates how to transform from loop variables to array indices for each
expression. Also generates code for scalar expressions which have been
/* Fills in an array descriptor, and returns the size of the array. The size
will be a simple_val, ie a variable or a constant. Also calculates the
- offset of the base. Returns the size of the arrary.
+ offset of the base. Returns the size of the array.
{
stride = 1;
offset = 0;
}
-/* Initialises the descriptor and generates a call to _gfor_allocate. Does
+/* Initializes the descriptor and generates a call to _gfor_allocate. Does
the work for an ALLOCATE statement. */
/*GCC ARRAYS*/
if (TREE_CODE (GFC_TYPE_ARRAY_OFFSET (type)) == VAR_DECL)
gfc_add_modify_expr (&block, GFC_TYPE_ARRAY_OFFSET (type), offset);
- /* Set the pointer itself if we aren't using the parameter dirtectly. */
+ /* Set the pointer itself if we aren't using the parameter directly. */
if (TREE_CODE (parm) != PARM_DECL)
{
tmp = convert (TREE_TYPE (parm), GFC_DECL_SAVED_DESCRIPTOR (parm));
else
{
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 necessary. */
tmp = GFC_DECL_SAVED_DESCRIPTOR (tmpdesc);
tmp = gfc_chainon_list (NULL_TREE, tmp);
stmt_unpacked = gfc_build_function_call (gfor_fndecl_in_pack, tmp);
newss = gfc_walk_subexpr (head, arg->expr);
if (newss == head)
{
- /* Scalar argumet. */
+ /* Scalar argument. */
newss = gfc_get_ss ();
newss->type = type;
newss->expr = arg->expr;
}
-/* Walk an expresson. Add walked expressions to the head of the SS chain.
+/* Walk an expression. Add walked expressions to the head of the SS chain.
A wholy scalar expression will not be added. */
static gfc_ss *
/* Entry point for expression walking.
A return value equal to the passed chain means this is
a scalar expression. It is up to the caller to take whatever action is
- neccessary to translate these. */
+ necessary to translate these. */
gfc_ss *
gfc_walk_expr (gfc_expr * expr)
/* Generate code to free an array. */
tree gfc_array_deallocate (tree);
-/* Generate code to initialise an allocate an array. Statements are added to
+/* Generate code to initialize an allocate an array. Statements are added to
se, which should contain an expression for the array descriptor. */
void gfc_array_allocate (gfc_se *, gfc_ref *, tree);
tree gfc_trans_dummy_array_bias (gfc_symbol *, tree, tree);
/* Generate entry and exit code for g77 calling convention arrays. */
tree gfc_trans_g77_array (gfc_symbol *, tree);
-/* Add initialisation for deferred arrays. */
+/* Add initialization for deferred arrays. */
tree gfc_trans_deferred_array (gfc_symbol *, tree);
/* Generate an initializer for a static pointer or allocatable array. */
void gfc_trans_static_array_pointer (gfc_symbol *);
gfc_ss *gfc_walk_intrinsic_function (gfc_ss *, gfc_expr *,
gfc_intrinsic_sym *);
-/* Free the SS assocuated with a loop. */
+/* Free the SS associated with a loop. */
void gfc_cleanup_loop (gfc_loopinfo *);
/* Associate a SS chain with a loop. */
void gfc_add_ss_to_loop (gfc_loopinfo *, gfc_ss *);
void gfc_trans_scalarizing_loops (gfc_loopinfo *, stmtblock_t *);
/* Mark the end of the main loop body and the start of the copying loop. */
void gfc_trans_scalarized_loop_boundary (gfc_loopinfo *, stmtblock_t *);
-/* Initialise the scalarization loop parameters. */
+/* Initialize the scalarization loop parameters. */
void gfc_conv_loop_setup (gfc_loopinfo *);
/* Resolve array assignment dependencies. */
void gfc_conv_resolve_dependencies (gfc_loopinfo *, gfc_ss *, gfc_ss *);
way to build UNION_TYPE is borrowed from Richard Henderson.
Transform common blocks. An integral part of this is processing
- equvalence variables. Equivalenced variables that are not in a
+ equivalence variables. Equivalenced variables that are not in a
common block end up in a private block of their own.
Each common block or local equivalence list is declared as a union.
if (s->offset < offset)
{
/* We have overlapping initializers. It could either be
- partially initilalized arrays (legal), or the user
+ partially initialized arrays (legal), or the user
specified multiple initial values (illegal).
We don't implement this yet, so bail out. */
gfc_todo_error ("Initialization of overlapping variables");
sym = z->expr->symtree->n.sym;
current_segment = get_segment_info (sym, 0);
- /* All objects directly or indrectly equivalenced with this symbol. */
+ /* All objects directly or indirectly equivalenced with this symbol. */
add_equivalences ();
/* Calculate the minimal offset. */
/* Create a tree node for the string length if it is constant. */
void gfc_conv_const_charlen (gfc_charlen *);
-/* Initialise the nodes for constants. */
+/* Initialize the nodes for constants. */
void gfc_init_constants (void);
/* Build a constant with given type from an int_cst. */
{
/* TODO: check if a pure SUBROUTINE has no INTENT(OUT) arguments
including a alternate return. In that case it can also be
- marked as PURE. See also in gfc_get_extern_fucntion_decl(). */
+ marked as PURE. See also in gfc_get_extern_function_decl(). */
if (attr.function)
DECL_IS_PURE (fndecl) = 1;
TREE_SIDE_EFFECTS (fndecl) = 0;
}
-/* Exaluate the length of dummy character variables. */
+/* Evaluate the length of dummy character variables. */
static tree
gfc_trans_dummy_character (gfc_charlen * cl, tree fnbody)
actual argument is passed according to the
corresponding formal argument. If the corresponding
formal argument is a POINTER or assumed shape, we do
- not use g77's calling aonvention, and pass the
+ not use g77's calling convention, and pass the
address of the array descriptor instead. Otherwise we
use g77's calling convention. */
int f;
}
/* Evaluate a single upper or lower bound. */
-/* TODO: bound intrinsic generates way too much unneccessary code. */
+/* TODO: bound intrinsic generates way too much unnecessary code. */
static void
gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper)
/* Verify that a set of characters contains all the characters in a string
- by indentifying the position of the first character in a string of
+ by identifying the position of the first character in a string of
characters that does not appear in a given set of characters. */
static void
gfc_add_block_to_block (&block, &se.pre);
step = se.expr;
- /* Initialise loop count. This code is executed before we enter the
+ /* Initialize loop count. This code is executed before we enter the
loop body. We generate: count = (to + step - from) / step. */
tmp = fold (build2 (MINUS_EXPR, type, step, from));
count = gfc_create_var (type, "count");
gfc_add_modify_expr (&block, count, tmp);
- /* Initialise the DO variable: dovar = from. */
+ /* Initialize the DO variable: dovar = from. */
gfc_add_modify_expr (&block, dovar, from);
/* Loop body. */
if (mask)
{
- /* If a mask was specified make the assignment contitional. */
+ /* If a mask was specified make the assignment conditional. */
if (pmask)
tmp = gfc_build_indirect_ref (mask);
else
}
else
{
- /* Initilize count2. */
+ /* Initialize count2. */
gfc_add_modify_expr (&block, count2, gfc_index_zero_node);
- /* Initiliaze the loop. */
+ /* Initialize the loop. */
gfc_init_loopinfo (&loop);
/* We may need LSS to determine the shape of the expression. */
tmp = generate_loop_for_rhs_to_temp (expr2, tmp1, inner_size, count,
count1, count2, lss, rss, wheremask);
- /* Generate body and loops according to the inforamtion in
+ /* Generate body and loops according to the information in
nested_forall_info. */
tmp = gfc_trans_nested_forall_loop (nested_forall_info, tmp, 1, 1);
gfc_add_expr_to_block (block, tmp);
tmp = generate_loop_for_temp_to_lhs (expr1, tmp1, inner_size, count,
count1, count2, wheremask);
- /* Generate body and loops according to the inforamtion in
+ /* Generate body and loops according to the information in
nested_forall_info. */
tmp = gfc_trans_nested_forall_loop (nested_forall_info, tmp, 1, 1);
gfc_add_expr_to_block (block, tmp);
forall_tmp = forall_tmp->next_nest;
}
- /* Generate body and loops according to the inforamtion in
+ /* Generate body and loops according to the information in
nested_forall_info. */
tmp = gfc_trans_nested_forall_loop (nested_forall_info, tmp, 1, 1);
gfc_add_expr_to_block (block, tmp);
gfc_add_modify_expr (&body, count, tmp);
tmp = gfc_finish_block (&body);
- /* Generate body and loops according to the inforamtion in
+ /* Generate body and loops according to the information in
nested_forall_info. */
tmp = gfc_trans_nested_forall_loop (nested_forall_info, tmp, 1, 1);
gfc_add_expr_to_block (block, tmp);
forall_tmp = forall_tmp->next_nest;
}
- /* Generate body and loops according to the inforamtion in
+ /* Generate body and loops according to the information in
nested_forall_info. */
tmp = gfc_trans_nested_forall_loop (nested_forall_info, tmp, 1, 1);
gfc_add_expr_to_block (block, tmp);
Note that this code only works when there are no dependencies.
Forall loop with array assignments and data dependencies are a real pain,
because the size of the temporary cannot always be determined before the
- loop is executed. This problem is compouded by the presence of nested
+ loop is executed. This problem is compounded by the presence of nested
FORALL constructs.
*/
switch (c->op)
{
case EXEC_ASSIGN:
- /* A scalar or array assingment. */
+ /* A scalar or array assignment. */
need_temp = gfc_check_dependency (c->expr, c->expr2, varexpr, nvar);
/* Teporaries due to array assignment data dependencies introduce
no end of problems. */
/* Variable to index the temporary. */
count = gfc_create_var (gfc_array_index_type, "count");
- /* Initilize count. */
+ /* Initialize count. */
gfc_add_modify_expr (block, count, gfc_index_zero_node);
gfc_start_block (&body);
}
else
{
- /* Initiliaze the loop. */
+ /* Initialize the loop. */
gfc_init_loopinfo (&loop);
/* We may need LSS to determine the shape of the expression. */
/* Translate the WHERE construct or statement.
- This fuction can be called iteratelly to translate the nested WHERE
+ This fuction can be called iteratively to translate the nested WHERE
construct or statement.
MASK is the control mask, and PMASK is the pending control mask.
TEMP records the temporary address which must be freed later. */
the calculation for stride02 would overflow. This may still work, but
I haven't checked, and it relies on the overflow doing the right thing.
- The way to fix this problem is to access alements as follows:
+ The way to fix this problem is to access elements as follows:
data[(index0-lbound0)*stride0 + (index1-lbound1)*stride1]
Obviously this is much slower. I will make this a compile time option,
something like -fsmall-array-offsets. Mixing code compiled with and without
field_type = gfc_typenode_for_spec (&c->ts);
}
- /* This returns an array descriptor type. Initialisation may be
+ /* This returns an array descriptor type. Initialization may be
required. */
if (c->dimension)
{
if (c->pointer)
{
- /* Pointers to arrays aren't actualy pointer types. The
+ /* Pointers to arrays aren't actually pointer types. The
descriptors are seperate, but the data is common. */
field_type = gfc_build_array_type (field_type, c->as);
}
/* Create a new scope/binding level and initialize a block. Care must be
- taken when translating expessions as any temporaries will be placed in
+ taken when translating expressions as any temporaries will be placed in
the innermost scope. */
void
}
stmtblock_t;
-/* a simplified expresson */
+/* a simplified expression */
typedef struct gfc_se
{
/* Code blocks to be executed before and after using the value. */
gfc_ss;
#define gfc_get_ss() gfc_getmem(sizeof(gfc_ss))
-/* The contents of this aren't actualy used. A NULL SS chain indicates a
+/* The contents of this aren't actually used. A NULL SS chain indicates a
scalar expression, so this pointer is used to terminate SS chains. */
extern gfc_ss * const gfc_ss_terminator;
/* Generate a runtime error check. */
void gfc_trans_runtime_check (tree, tree, stmtblock_t *);
-/* Generate code for an assigment, includes scalarization. */
+/* Generate code for an assignment, includes scalarization. */
tree gfc_trans_assignment (gfc_expr *, gfc_expr *);
/* Generate code for an pointer assignment. */
tree saved_descriptor;
/* Assigned integer nodes. Stringlength is the IO format string's length.
Addr is the address of the string or the target label. Stringlength is
- initialized to -2 and assiged to -1 when addr is assigned to the
+ initialized to -2 and assigned to -1 when addr is assigned to the
address of target label. */
tree stringlen;
tree addr;