+2015-01-25 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/62044
+ * decl.c (gfc_match_derived_decl): Don't insert a new symtree element.
+ * module.c (MOD_VERSION): Bump.
+ (write_module): Don't write list of extensions.
+ (read_module): Don't jump over list of extensions;
+ don't load list of extensions.
+ (load_derived_extensions, write_dt_extensions,
+ write_derived_extensions): Remove.
+
2015-01-24 Tobias Burnus <burnus@net-b.de>
* parse.c (gfc_parse_file): Fix two-location gfc_error call.
* decl.c (match_pointer_init): Error out if resolution of init expr
failed.
->>>>>>> .r219925
2015-01-15 Tobias Burnus <burnus@net-b.de>
* openmp.c (check_symbol_not_pointer, resolve_oacc_data_clauses,
/* Don't put any single quote (') in MOD_VERSION, if you want it to be
recognized. */
-#define MOD_VERSION "13"
+#define MOD_VERSION "14"
/* Structure that describes a position within a module file. */
}
-/* This function loads the sym_root of f2k_derived with the extensions to
- the derived type. */
-static void
-load_derived_extensions (void)
-{
- int symbol, j;
- gfc_symbol *derived;
- gfc_symbol *dt;
- gfc_symtree *st;
- pointer_info *info;
- char name[GFC_MAX_SYMBOL_LEN + 1];
- char module[GFC_MAX_SYMBOL_LEN + 1];
- const char *p;
-
- mio_lparen ();
- while (peek_atom () != ATOM_RPAREN)
- {
- mio_lparen ();
- mio_integer (&symbol);
- info = get_integer (symbol);
- derived = info->u.rsym.sym;
-
- /* This one is not being loaded. */
- if (!info || !derived)
- {
- while (peek_atom () != ATOM_RPAREN)
- skip_list ();
- continue;
- }
-
- gcc_assert (derived->attr.flavor == FL_DERIVED);
- if (derived->f2k_derived == NULL)
- derived->f2k_derived = gfc_get_namespace (NULL, 0);
-
- while (peek_atom () != ATOM_RPAREN)
- {
- mio_lparen ();
- mio_internal_string (name);
- mio_internal_string (module);
-
- /* Only use one use name to find the symbol. */
- j = 1;
- p = find_use_name_n (name, &j, false);
- if (p)
- {
- st = gfc_find_symtree (gfc_current_ns->sym_root, p);
- dt = st->n.sym;
- st = gfc_find_symtree (derived->f2k_derived->sym_root, name);
- if (st == NULL)
- {
- /* Only use the real name in f2k_derived to ensure a single
- symtree. */
- st = gfc_new_symtree (&derived->f2k_derived->sym_root, name);
- st->n.sym = dt;
- st->n.sym->refs++;
- }
- }
- mio_rparen ();
- }
- mio_rparen ();
- }
- mio_rparen ();
-}
-
-
/* This function loads OpenMP user defined reductions. */
static void
load_omp_udrs (void)
static void
read_module (void)
{
- module_locus operator_interfaces, user_operators, extensions, omp_udrs;
+ module_locus operator_interfaces, user_operators, omp_udrs;
const char *p;
char name[GFC_MAX_SYMBOL_LEN + 1];
int i;
skip_list ();
skip_list ();
- /* Skip commons, equivalences and derived type extensions for now. */
+ /* Skip commons and equivalences for now. */
skip_list ();
skip_list ();
- get_module_locus (&extensions);
- skip_list ();
-
/* Skip OpenMP UDRs. */
get_module_locus (&omp_udrs);
skip_list ();
module_name);
}
- /* Now we should be in a position to fill f2k_derived with derived type
- extensions, since everything has been loaded. */
- set_module_locus (&extensions);
- load_derived_extensions ();
-
/* Clean up symbol nodes that were never loaded, create references
to hidden symbols. */
}
-/* Write derived type extensions to the module. */
-
-static void
-write_dt_extensions (gfc_symtree *st)
-{
- if (!gfc_check_symbol_access (st->n.sym))
- return;
- if (!(st->n.sym->ns && st->n.sym->ns->proc_name
- && st->n.sym->ns->proc_name->attr.flavor == FL_MODULE))
- return;
-
- mio_lparen ();
- mio_pool_string (&st->name);
- if (st->n.sym->module != NULL)
- mio_pool_string (&st->n.sym->module);
- else
- {
- char name[GFC_MAX_SYMBOL_LEN + 1];
- if (iomode == IO_OUTPUT)
- strcpy (name, module_name);
- mio_internal_string (name);
- if (iomode == IO_INPUT)
- module_name = gfc_get_string (name);
- }
- mio_rparen ();
-}
-
-static void
-write_derived_extensions (gfc_symtree *st)
-{
- if (!((st->n.sym->attr.flavor == FL_DERIVED)
- && (st->n.sym->f2k_derived != NULL)
- && (st->n.sym->f2k_derived->sym_root != NULL)))
- return;
-
- mio_lparen ();
- mio_symbol_ref (&(st->n.sym));
- gfc_traverse_symtree (st->n.sym->f2k_derived->sym_root,
- write_dt_extensions);
- mio_rparen ();
-}
-
-
/* Write a symbol to the module. */
static void
write_char ('\n');
write_char ('\n');
- mio_lparen ();
- gfc_traverse_symtree (gfc_current_ns->sym_root,
- write_derived_extensions);
- mio_rparen ();
- write_char ('\n');
- write_char ('\n');
-
mio_lparen ();
write_omp_udrs (gfc_current_ns->omp_udr_root);
mio_rparen ();
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/62044
+! ICE when loading module UnstructuredGridImages
+! because the type UnstructuredGridImageSiloForm
+! is not accessible there under its name.
+!
+! Contributed by Reuben Budiardja <reubendb@gmail.com>
+
+module UnstructuredGridImageSilo_Form
+ implicit none
+ private
+ type, public, abstract :: GridImageSiloTemplate
+ end type GridImageSiloTemplate
+ type, public, extends ( GridImageSiloTemplate ) :: &
+ UnstructuredGridImageSiloForm
+ end type UnstructuredGridImageSiloForm
+end module UnstructuredGridImageSilo_Form
+
+module UnstructuredGridImages
+ use UnstructuredGridImageSilo_Form, &
+ UnstructuredGridImageForm => UnstructuredGridImageSiloForm
+end module UnstructuredGridImages
+
+module FileSystem
+ use UnstructuredGridImages
+end module FileSystem