Commit f5e440e1 by Tobias Schlüter Committed by Tobias Schlüter

resolve.c (resolve_symbol): Add comment in function body.

* resolve.c (resolve_symbol): Add comment in function body.
(check_data_variable): Change type of mark to ar_type, adapt code
accordingly.

From-SVN: r83443
parent da4f9e3b
2004-06-21 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> 2004-06-21 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* resolve.c (resolve_symbol): Add comment in function body.
(check_data_variable): Change type of mark to ar_type, adapt code
accordingly.
2004-06-21 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* array.c (gfc_insert_constructor): Avoid redundant call to * array.c (gfc_insert_constructor): Avoid redundant call to
mpz_comp. Add 2004 to copyright years. mpz_comp. Add 2004 to copyright years.
......
...@@ -3724,6 +3724,9 @@ resolve_symbol (gfc_symbol * sym) ...@@ -3724,6 +3724,9 @@ resolve_symbol (gfc_symbol * sym)
} }
} }
/* Assumed size arrays and assumed shape arrays must be dummy
arguments. */
if (sym->as != NULL if (sym->as != NULL
&& (sym->as->type == AS_ASSUMED_SIZE && (sym->as->type == AS_ASSUMED_SIZE
|| sym->as->type == AS_ASSUMED_SHAPE) || sym->as->type == AS_ASSUMED_SHAPE)
...@@ -3945,7 +3948,7 @@ check_data_variable (gfc_data_variable * var, locus * where) ...@@ -3945,7 +3948,7 @@ check_data_variable (gfc_data_variable * var, locus * where)
mpz_t size; mpz_t size;
mpz_t offset; mpz_t offset;
try t; try t;
int mark = 0; ar_type mark = AR_UNKNOWN;
int i; int i;
mpz_t section_index[GFC_MAX_DIMENSIONS]; mpz_t section_index[GFC_MAX_DIMENSIONS];
gfc_ref *ref; gfc_ref *ref;
...@@ -3982,14 +3985,14 @@ check_data_variable (gfc_data_variable * var, locus * where) ...@@ -3982,14 +3985,14 @@ check_data_variable (gfc_data_variable * var, locus * where)
switch (ref->u.ar.type) switch (ref->u.ar.type)
{ {
case AR_FULL: case AR_FULL:
mark = 1; mark = AR_FULL;
break; break;
case AR_SECTION: case AR_SECTION:
ar = &ref->u.ar; ar = &ref->u.ar;
/* Get the start position of array section. */ /* Get the start position of array section. */
gfc_get_section_index (ar, section_index, &offset); gfc_get_section_index (ar, section_index, &offset);
mark = 2; mark = AR_SECTION;
break; break;
default: default:
...@@ -4024,17 +4027,17 @@ check_data_variable (gfc_data_variable * var, locus * where) ...@@ -4024,17 +4027,17 @@ check_data_variable (gfc_data_variable * var, locus * where)
/* Assign initial value to symbol. */ /* Assign initial value to symbol. */
gfc_assign_data_value (var->expr, values.vnode->expr, offset); gfc_assign_data_value (var->expr, values.vnode->expr, offset);
if (mark == 1) if (mark == AR_FULL)
mpz_add_ui (offset, offset, 1); mpz_add_ui (offset, offset, 1);
/* Modify the array section indexes and recalculate the offset for /* Modify the array section indexes and recalculate the offset for
next element. */ next element. */
else if (mark == 2) else if (mark == AR_SECTION)
gfc_advance_section (section_index, ar, &offset); gfc_advance_section (section_index, ar, &offset);
mpz_sub_ui (size, size, 1); mpz_sub_ui (size, size, 1);
} }
if (mark == 2) if (mark == AR_SECTION)
{ {
for (i = 0; i < ar->dimen; i++) for (i = 0; i < ar->dimen; i++)
mpz_clear (section_index[i]); mpz_clear (section_index[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment