From f5e440e11d2a06873d52c3443f624d537788600d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tobias=20Schl=C3=BCter?= Date: Mon, 21 Jun 2004 19:23:52 +0200 Subject: [PATCH] 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 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/resolve.c | 15 +++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index d0e4e874618..4677f3921bf 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2004-06-21 Tobias Schlueter + + * 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 * array.c (gfc_insert_constructor): Avoid redundant call to diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index b19721f1432..77ac3d4bb8d 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -3724,6 +3724,9 @@ resolve_symbol (gfc_symbol * sym) } } + /* Assumed size arrays and assumed shape arrays must be dummy + arguments. */ + if (sym->as != NULL && (sym->as->type == AS_ASSUMED_SIZE || sym->as->type == AS_ASSUMED_SHAPE) @@ -3945,7 +3948,7 @@ check_data_variable (gfc_data_variable * var, locus * where) mpz_t size; mpz_t offset; try t; - int mark = 0; + ar_type mark = AR_UNKNOWN; int i; mpz_t section_index[GFC_MAX_DIMENSIONS]; gfc_ref *ref; @@ -3982,14 +3985,14 @@ check_data_variable (gfc_data_variable * var, locus * where) switch (ref->u.ar.type) { case AR_FULL: - mark = 1; + mark = AR_FULL; break; case AR_SECTION: ar = &ref->u.ar; /* Get the start position of array section. */ gfc_get_section_index (ar, section_index, &offset); - mark = 2; + mark = AR_SECTION; break; default: @@ -4024,17 +4027,17 @@ check_data_variable (gfc_data_variable * var, locus * where) /* Assign initial value to symbol. */ gfc_assign_data_value (var->expr, values.vnode->expr, offset); - if (mark == 1) + if (mark == AR_FULL) mpz_add_ui (offset, offset, 1); /* Modify the array section indexes and recalculate the offset for next element. */ - else if (mark == 2) + else if (mark == AR_SECTION) gfc_advance_section (section_index, ar, &offset); mpz_sub_ui (size, size, 1); } - if (mark == 2) + if (mark == AR_SECTION) { for (i = 0; i < ar->dimen; i++) mpz_clear (section_index[i]); -- 2.30.2