* trans-common.c (create_common): Remove unused offset variable.
* io.c (gfc_match_wait): Remove unused loc variable.
* trans-openmp.c (gfc_trans_omp_clauses): Remove unused old_clauses
variable.
(gfc_trans_omp_do): Remove unused outermost variable.
* iresolve.c (gfc_resolve_alarm_sub, gfc_resolve_fseek_sub): Remove
unused status variable.
* module.c (number_use_names): Remove unused c variable.
(load_derived_extensions): Remove unused nuse variable.
* trans-expr.c (gfc_conv_substring): Remove unused var variable.
* trans-types.c (gfc_get_array_descr_info): Remove unused offset_off
variable.
* matchexp.c (match_primary): Remove unused where variable.
* trans-intrinsic.c (gfc_conv_intrinsic_bound): Remove unused cond2
variable.
(gfc_conv_intrinsic_sizeof): Remove unused source variable.
(gfc_conv_intrinsic_transfer): Remove unused stride variable.
(gfc_conv_intrinsic_function): Remove unused isym variable.
* arith.c (gfc_hollerith2real, gfc_hollerith2complex,
gfc_hollerith2logical): Remove unused len variable.
* parse.c (parse_derived): Remove unused derived_sym variable.
* decl.c (variable_decl): Remove unused old_locus variable.
* resolve.c (check_class_members): Remove unused tbp_sym variable.
(resolve_ordinary_assign): Remove unused assign_proc variable.
(resolve_equivalence): Remove unused value_name variable.
* data.c (get_array_index): Remove unused re variable.
* trans-array.c (gfc_conv_array_transpose): Remove unused src_info
variable.
(gfc_conv_resolve_dependencies): Remove unused aref and temp_dim
variables.
(gfc_conv_loop_setup): Remove unused dim and len variables.
(gfc_walk_variable_expr): Remove unused head variable.
* match.c (match_typebound_call): Remove unused var variable.
* intrinsic.c (gfc_convert_chartype): Remove unused from_ts variable.
From-SVN: r154722
+2009-11-28 Jakub Jelinek <jakub@redhat.com>
+
+ * trans-common.c (create_common): Remove unused offset variable.
+ * io.c (gfc_match_wait): Remove unused loc variable.
+ * trans-openmp.c (gfc_trans_omp_clauses): Remove unused old_clauses
+ variable.
+ (gfc_trans_omp_do): Remove unused outermost variable.
+ * iresolve.c (gfc_resolve_alarm_sub, gfc_resolve_fseek_sub): Remove
+ unused status variable.
+ * module.c (number_use_names): Remove unused c variable.
+ (load_derived_extensions): Remove unused nuse variable.
+ * trans-expr.c (gfc_conv_substring): Remove unused var variable.
+ * trans-types.c (gfc_get_array_descr_info): Remove unused offset_off
+ variable.
+ * matchexp.c (match_primary): Remove unused where variable.
+ * trans-intrinsic.c (gfc_conv_intrinsic_bound): Remove unused cond2
+ variable.
+ (gfc_conv_intrinsic_sizeof): Remove unused source variable.
+ (gfc_conv_intrinsic_transfer): Remove unused stride variable.
+ (gfc_conv_intrinsic_function): Remove unused isym variable.
+ * arith.c (gfc_hollerith2real, gfc_hollerith2complex,
+ gfc_hollerith2logical): Remove unused len variable.
+ * parse.c (parse_derived): Remove unused derived_sym variable.
+ * decl.c (variable_decl): Remove unused old_locus variable.
+ * resolve.c (check_class_members): Remove unused tbp_sym variable.
+ (resolve_ordinary_assign): Remove unused assign_proc variable.
+ (resolve_equivalence): Remove unused value_name variable.
+ * data.c (get_array_index): Remove unused re variable.
+ * trans-array.c (gfc_conv_array_transpose): Remove unused src_info
+ variable.
+ (gfc_conv_resolve_dependencies): Remove unused aref and temp_dim
+ variables.
+ (gfc_conv_loop_setup): Remove unused dim and len variables.
+ (gfc_walk_variable_expr): Remove unused head variable.
+ * match.c (match_typebound_call): Remove unused var variable.
+ * intrinsic.c (gfc_convert_chartype): Remove unused from_ts variable.
+
2009-11-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/41807
/* Compiler arithmetic
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Andy Vaught
gfc_hollerith2real (gfc_expr *src, int kind)
{
gfc_expr *result;
- int len;
-
- len = src->value.character.length;
result = gfc_get_expr ();
result->expr_type = EXPR_CONSTANT;
gfc_hollerith2complex (gfc_expr *src, int kind)
{
gfc_expr *result;
- int len;
-
- len = src->value.character.length;
result = gfc_get_expr ();
result->expr_type = EXPR_CONSTANT;
gfc_hollerith2logical (gfc_expr *src, int kind)
{
gfc_expr *result;
- int len;
-
- len = src->value.character.length;
result = gfc_get_expr ();
result->expr_type = EXPR_CONSTANT;
/* Supporting functions for resolving DATA statement.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Lifang Zeng <zlf605@hotmail.com>
{
gfc_expr *e;
int i;
- gfc_try re;
mpz_t delta;
mpz_t tmp;
for (i = 0; i < ar->dimen; i++)
{
e = gfc_copy_expr (ar->start[i]);
- re = gfc_simplify_expr (e, 1);
+ gfc_simplify_expr (e, 1);
if ((gfc_is_constant_expr (ar->as->lower[i]) == 0)
|| (gfc_is_constant_expr (ar->as->upper[i]) == 0)
match m;
gfc_try t;
gfc_symbol *sym;
- locus old_locus;
initializer = NULL;
as = NULL;
cp_as = NULL;
- old_locus = gfc_current_locus;
/* When we get here, we've just matched a list of attributes and
maybe a type and a double colon. The next thing we expect to see
gfc_convert_chartype (gfc_expr *expr, gfc_typespec *ts)
{
gfc_intrinsic_sym *sym;
- gfc_typespec from_ts;
locus old_where;
gfc_expr *new_expr;
int rank;
mpz_t *shape;
gcc_assert (expr->ts.type == BT_CHARACTER && ts->type == BT_CHARACTER);
- from_ts = expr->ts; /* expr->ts gets clobbered */
sym = find_char_conv (&expr->ts, ts);
gcc_assert (sym);
{
gfc_wait *wait;
match m;
- locus loc;
m = gfc_match_char ('(');
if (m == MATCH_NO)
wait = XCNEW (gfc_wait);
- loc = gfc_current_locus;
-
m = match_wait_element (wait);
if (m == MATCH_ERROR)
goto cleanup;
/* Intrinsic function resolution.
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Andy Vaught & Katherine Holcomb
gfc_resolve_alarm_sub (gfc_code *c)
{
const char *name;
- gfc_expr *seconds, *handler, *status;
+ gfc_expr *seconds, *handler;
gfc_typespec ts;
gfc_clear_ts (&ts);
seconds = c->ext.actual->expr;
handler = c->ext.actual->next->expr;
- status = c->ext.actual->next->next->expr;
ts.type = BT_INTEGER;
ts.kind = gfc_c_int_kind;
gfc_expr *unit;
gfc_expr *offset;
gfc_expr *whence;
- gfc_expr *status;
gfc_typespec ts;
gfc_clear_ts (&ts);
unit = c->ext.actual->expr;
offset = c->ext.actual->next->expr;
whence = c->ext.actual->next->next->expr;
- status = c->ext.actual->next->next->next->expr;
if (unit->ts.kind != gfc_c_int_kind)
{
/* Matching subroutines in all sizes, shapes and colors.
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Andy Vaught
static match
match_typebound_call (gfc_symtree* varst)
{
- gfc_symbol* var;
gfc_expr* base;
match m;
- var = varst->n.sym;
-
base = gfc_get_expr ();
base->expr_type = EXPR_VARIABLE;
base->symtree = varst;
/* Expression parser.
- Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008
+ Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Andy Vaught
{
match m;
gfc_expr *e;
- locus where;
m = gfc_match_literal_constant (result, 0);
if (m != MATCH_NO)
return m;
/* Match an expression in parentheses. */
- where = gfc_current_locus;
-
if (gfc_match_char ('(') != MATCH_YES)
return MATCH_NO;
number_use_names (const char *name, bool interface)
{
int i = 0;
- const char *c;
- c = find_use_name_n (name, &i, interface);
+ find_use_name_n (name, &i, interface);
return i;
}
static void
load_derived_extensions (void)
{
- int symbol, nuse, j;
+ int symbol, j;
gfc_symbol *derived;
gfc_symbol *dt;
gfc_symtree *st;
mio_internal_string (module);
/* Only use one use name to find the symbol. */
- nuse = number_use_names (name, false);
j = 1;
p = find_use_name_n (name, &j, false);
if (p)
int compiling_type, seen_private, seen_sequence, seen_component, error_flag;
gfc_statement st;
gfc_state_data s;
- gfc_symbol *derived_sym = NULL;
gfc_symbol *sym;
gfc_component *c;
/* need to verify that all fields of the derived type are
* interoperable with C if the type is declared to be bind(c)
*/
- derived_sym = gfc_current_block();
-
sym = gfc_current_block ();
for (c = sym->components; c; c = c->next)
{
static void
check_class_members (gfc_symbol *derived)
{
- gfc_symbol* tbp_sym;
gfc_expr *e;
gfc_symtree *tbp;
gfc_class_esym_list *etmp;
if (tbp->n.tb->is_generic)
{
- tbp_sym = NULL;
-
/* If we have to match a passed class member, force the actual
expression to have the correct type. */
if (!tbp->n.tb->nopass)
e->value.compcall.base_object->ts.u.derived = derived;
}
}
- else
- tbp_sym = tbp->n.tb->u.specific->n.sym;
e->value.compcall.tbp = tbp->n.tb;
e->value.compcall.name = tbp->name;
if (gfc_extend_assign (code, ns) == SUCCESS)
{
- gfc_symbol* assign_proc;
gfc_expr** rhsptr;
if (code->op == EXEC_ASSIGN_CALL)
{
lhs = code->ext.actual->expr;
rhsptr = &code->ext.actual->next->expr;
- assign_proc = code->symtree->n.sym;
}
else
{
tbp = code->expr1->value.compcall.tbp;
gcc_assert (!tbp->is_generic);
- assign_proc = tbp->u.specific->n.sym;
}
/* Make a temporary rhs when there is a default initializer
seq_type eq_type, last_eq_type;
gfc_typespec *last_ts;
int object, cnt_protected;
- const char *value_name;
const char *msg;
- value_name = NULL;
last_ts = &eq->expr->symtree->n.sym->ts;
first_sym = eq->expr->symtree->n.sym;
{
tree dest, src, dest_index, src_index;
gfc_loopinfo *loop;
- gfc_ss_info *dest_info, *src_info;
+ gfc_ss_info *dest_info;
gfc_ss *dest_ss, *src_ss;
gfc_se src_se;
int n;
src_ss = gfc_walk_expr (expr);
dest_ss = se->ss;
- src_info = &src_ss->data.info;
dest_info = &dest_ss->data.info;
gcc_assert (dest_info->dimen == 2);
gfc_ss *ss;
gfc_ref *lref;
gfc_ref *rref;
- gfc_ref *aref;
int nDepend = 0;
- int temp_dim = 0;
loop->temp_ss = NULL;
- aref = dest->data.info.ref;
- temp_dim = 0;
for (ss = rss; ss != gfc_ss_terminator; ss = ss->next)
{
if (depends[n])
loop->order[dim++] = n;
}
- temp_dim = dim;
for (n = 0; n < loop->dimen; n++)
{
if (! depends[n])
gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
{
int n;
- int dim;
gfc_ss_info *info;
gfc_ss_info *specinfo;
gfc_ss *ss;
tree tmp;
- tree len;
gfc_ss *loopspec[GFC_MAX_DIMENSIONS];
bool dynamic[GFC_MAX_DIMENSIONS];
gfc_constructor *c;
loop->temp_ss->string_length);
tmp = loop->temp_ss->data.temp.type;
- len = loop->temp_ss->string_length;
n = loop->temp_ss->data.temp.dimen;
memset (&loop->temp_ss->data.info, 0, sizeof (gfc_ss_info));
loop->temp_ss->type = GFC_SS_SECTION;
for (n = 0; n < info->dimen; n++)
{
- dim = info->dim[n];
-
/* If we are specifying the range the delta is already set. */
if (loopspec[n] != ss)
{
gfc_ref *ref;
gfc_array_ref *ar;
gfc_ss *newss;
- gfc_ss *head;
int n;
for (ref = expr->ref; ref; ref = ref->next)
newss->data.info.dimen = 0;
newss->data.info.ref = ref;
- head = newss;
-
/* We add SS chains for all the subscripts in the section. */
for (n = 0; n < ar->dimen; n++)
{
/* Common block and equivalence list handling
- Copyright (C) 2000, 2003, 2004, 2005, 2006, 2007, 2008
+ Copyright (C) 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Canqun Yang <canqun@nudt.edu.cn>
if (is_init)
{
tree ctor, tmp;
- HOST_WIDE_INT offset = 0;
VEC(constructor_elt,gc) *v = NULL;
if (field != NULL_TREE && field_init != NULL_TREE)
s->sym->attr.pointer || s->sym->attr.allocatable);
CONSTRUCTOR_APPEND_ELT (v, s->field, tmp);
- offset = s->offset + s->length;
}
}
{
tree tmp;
tree type;
- tree var;
tree fault;
gfc_se start;
gfc_se end;
type = gfc_get_character_type (kind, ref->u.ss.length);
type = build_pointer_type (type);
- var = NULL_TREE;
gfc_init_se (&start, se);
gfc_conv_expr_type (&start, ref->u.ss.start, gfc_charlen_type_node);
gfc_add_block_to_block (&se->pre, &start.pre);
tree type;
tree bound;
tree tmp;
- tree cond, cond1, cond2, cond3, cond4, size;
+ tree cond, cond1, cond3, cond4, size;
tree ubound;
tree lbound;
gfc_se argse;
tree stride = gfc_conv_descriptor_stride_get (desc, bound);
cond1 = fold_build2 (GE_EXPR, boolean_type_node, ubound, lbound);
- cond2 = fold_build2 (LE_EXPR, boolean_type_node, ubound, lbound);
cond3 = fold_build2 (GE_EXPR, boolean_type_node, stride,
gfc_index_zero_node);
gfc_expr *arg;
gfc_ss *ss;
gfc_se argse;
- tree source;
tree source_bytes;
tree type;
tree tmp;
if (ss == gfc_ss_terminator)
{
gfc_conv_expr_reference (&argse, arg);
- source = argse.expr;
type = TREE_TYPE (build_fold_indirect_ref_loc (input_location,
argse.expr));
source_bytes = gfc_create_var (gfc_array_index_type, "bytes");
argse.want_pointer = 0;
gfc_conv_expr_descriptor (&argse, arg, ss);
- source = gfc_conv_descriptor_data_get (argse.expr);
type = gfc_get_element_type (TREE_TYPE (argse.expr));
/* Obtain the argument's word length. */
tree size_bytes;
tree upper;
tree lower;
- tree stride;
tree stmt;
gfc_actual_arglist *arg;
gfc_se argse;
tree idx;
idx = gfc_rank_cst[n];
gfc_add_modify (&argse.pre, source_bytes, tmp);
- stride = gfc_conv_descriptor_stride_get (argse.expr, idx);
lower = gfc_conv_descriptor_lbound_get (argse.expr, idx);
upper = gfc_conv_descriptor_ubound_get (argse.expr, idx);
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
void
gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
{
- gfc_intrinsic_sym *isym;
const char *name;
int lib, kind;
tree fndecl;
- isym = expr->value.function.isym;
-
name = &expr->value.function.name[2];
if (expr->rank > 0 && !expr->inline_noncopying_intrinsic)
gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
locus where)
{
- tree omp_clauses = NULL_TREE, chunk_size, c, old_clauses;
+ tree omp_clauses = NULL_TREE, chunk_size, c;
int list;
enum omp_clause_code clause_code;
gfc_se se;
default:
gcc_unreachable ();
}
- old_clauses = omp_clauses;
omp_clauses
= gfc_trans_omp_reduction_list (n, omp_clauses, reduction_code,
where);
stmtblock_t block;
stmtblock_t body;
gfc_omp_clauses *clauses = code->ext.omp_clauses;
- gfc_code *outermost;
int i, collapse = clauses->collapse;
tree dovar_init = NULL_TREE;
if (collapse <= 0)
collapse = 1;
- outermost = code = code->block->next;
+ code = code->block->next;
gcc_assert (code->op == EXEC_DO);
init = make_tree_vec (collapse);
int rank, dim;
bool indirect = false;
tree etype, ptype, field, t, base_decl;
- tree data_off, offset_off, dim_off, dim_size, elem_size;
+ tree data_off, dim_off, dim_size, elem_size;
tree lower_suboff, upper_suboff, stride_suboff;
if (! GFC_DESCRIPTOR_TYPE_P (type))
field = TYPE_FIELDS (TYPE_MAIN_VARIANT (type));
data_off = byte_position (field);
field = TREE_CHAIN (field);
- offset_off = byte_position (field);
field = TREE_CHAIN (field);
field = TREE_CHAIN (field);
dim_off = byte_position (field);