aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index a498d19..beafe8d 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -12274,13 +12274,8 @@ deferred_requirements (gfc_symbol *sym)
static bool
resolve_fl_variable (gfc_symbol *sym, int mp_flag)
{
- int no_init_flag, automatic_flag;
- gfc_expr *e;
- const char *auto_save_msg;
- bool saved_specification_expr;
-
- auto_save_msg = "Automatic object %qs at %L cannot have the "
- "SAVE attribute";
+ const char *auto_save_msg = "Automatic object %qs at %L cannot have the "
+ "SAVE attribute";
if (!resolve_fl_var_and_proc (sym, mp_flag))
return false;
@@ -12288,7 +12283,7 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
/* Set this flag to check that variables are parameters of all entries.
This check is effected by the call to gfc_resolve_expr through
is_non_constant_shape_array. */
- saved_specification_expr = specification_expr;
+ bool saved_specification_expr = specification_expr;
specification_expr = true;
if (sym->ns->proc_name
@@ -12315,6 +12310,8 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
{
/* Make sure that character string variables with assumed length are
dummy arguments. */
+ gfc_expr *e = NULL;
+
if (sym->ts.u.cl)
e = sym->ts.u.cl->length;
else
@@ -12364,7 +12361,7 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
apply_default_init_local (sym); /* Try to apply a default initialization. */
/* Determine if the symbol may not have an initializer. */
- no_init_flag = automatic_flag = 0;
+ int no_init_flag = 0, automatic_flag = 0;
if (sym->attr.allocatable || sym->attr.external || sym->attr.dummy
|| sym->attr.intrinsic || sym->attr.result)
no_init_flag = 1;
@@ -12494,7 +12491,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
module procedures are excluded by 2.2.3.3 - i.e., they are not
externally accessible and can access all the objects accessible in
the host. */
- if (!(sym->ns->parent
+ if (!(sym->ns->parent && sym->ns->parent->proc_name
&& sym->ns->parent->proc_name->attr.flavor == FL_MODULE)
&& gfc_check_symbol_access (sym))
{