aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-decl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/trans-decl.cc')
-rw-r--r--gcc/fortran/trans-decl.cc38
1 files changed, 24 insertions, 14 deletions
diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc
index 8dd1c93..ddc4960 100644
--- a/gcc/fortran/trans-decl.cc
+++ b/gcc/fortran/trans-decl.cc
@@ -6546,7 +6546,7 @@ add_argument_checking (stmtblock_t *block, gfc_symbol *sym)
message = _("Actual string length does not match the declared one"
" for dummy argument '%s' (%ld/%ld)");
}
- else if (fsym->as && fsym->as->rank != 0)
+ else if ((fsym->as && fsym->as->rank != 0) || fsym->attr.artificial)
continue;
else
{
@@ -6920,6 +6920,7 @@ add_clause (gfc_symbol *sym, gfc_omp_map_op map_op)
n = gfc_get_omp_namelist ();
n->sym = sym;
+ n->where = sym->declared_at;
n->u.map.op = map_op;
if (!module_oacc_clauses)
@@ -8361,23 +8362,17 @@ gfc_generate_block_data (gfc_namespace * ns)
rest_of_decl_compilation (decl, 1, 0);
}
-
-/* Process the local variables of a BLOCK construct. */
-
void
-gfc_process_block_locals (gfc_namespace* ns)
+gfc_start_saved_local_decls ()
{
- tree decl;
-
+ gcc_checking_assert (current_function_decl != NULL_TREE);
saved_local_decls = NULL_TREE;
- has_coarray_vars_or_accessors = caf_accessor_head != NULL;
-
- generate_local_vars (ns);
-
- if (flag_coarray == GFC_FCOARRAY_LIB && has_coarray_vars_or_accessors)
- generate_coarray_init (ns);
+}
- decl = nreverse (saved_local_decls);
+void
+gfc_stop_saved_local_decls ()
+{
+ tree decl = nreverse (saved_local_decls);
while (decl)
{
tree next;
@@ -8390,5 +8385,20 @@ gfc_process_block_locals (gfc_namespace* ns)
saved_local_decls = NULL_TREE;
}
+/* Process the local variables of a BLOCK construct. */
+
+void
+gfc_process_block_locals (gfc_namespace* ns)
+{
+ gfc_start_saved_local_decls ();
+ has_coarray_vars_or_accessors = caf_accessor_head != NULL;
+
+ generate_local_vars (ns);
+
+ if (flag_coarray == GFC_FCOARRAY_LIB && has_coarray_vars_or_accessors)
+ generate_coarray_init (ns);
+ gfc_stop_saved_local_decls ();
+}
+
#include "gt-fortran-trans-decl.h"