[Patch, gfortran] Tidy up repeated symbols in .mod files (cf. patch for PR 16861)

Steve Kargl sgk@troutmask.apl.washington.edu
Sat Sep 17 15:36:00 GMT 2005


On Sat, Sep 17, 2005 at 10:55:53AM +0200, Paul Thomas wrote:
> 
> Thanks for clearing http://gcc.gnu.org/ml/fortran/2005-09/msg00316.html 
> so quickly.  I'll commit it this afternoon.

(1) I'm back for limited duties. :-)
(2) Your patch was short and simple. :-)
(3) Your email was at the bottom of queue.  LIFO :-)

> As mentioned in the above, such indices for contained assumed shape 
> arrays cause multiple entries of the same symbol
> in .mod files, when the reference to the index is resolved with a use 
> associated symbol.  The patch below cures this
> "problem"(ie. nothing is broken) by eliminating extraneous symbol 
> entries.  The comment speaks for itself.

I actually didn't see the multiple symbols in a *.mod
as a problem, particularly if we will need to make 
further bug fixes.

> *** module.c    2005-09-17 10:54:31.743944128 +0200
> --- gcc/gcc/fortran/module.c    2005-09-17 10:37:25.677929872 +0200
> *************** mio_symtree_ref (gfc_symtree ** stp)
> *** 2091,2097 ****
> 
>    if (iomode == IO_OUTPUT)
>      {
> !       mio_symbol_ref (&(*stp)->n.sym);
>      }
>    else
>      {
> --- 2091,2105 ----
> 
>    if (iomode == IO_OUTPUT)
>      {
> !       /* If this is a symtree for a symbol that came from a contained
> !      module namespace, it has a "unique" name and we should look in
> !      the current namespace to see if the required, non-contained
> !      symbol is available yet.  */
> !       if ((*stp)->n.sym && check_unique_name((*stp)->name))
> !     ns_st = gfc_find_symtree (gfc_current_ns->sym_root,
> !                   (*stp)->n.sym->name);
> !
> !       mio_symbol_ref (ns_st ? &ns_st->n.sym : &(*stp)->n.sym);
>      }


There's a whole bunch of whitespace issues.  It appears
that some tabs may have been convertes to spaces.  But
the big problem is 

../gcc41/gcc/fortran/module.c -o fortran/module.o
../../gcc41/gcc/fortran/module.c: In function 'mio_symtree_ref':
../../gcc41/gcc/fortran/module.c:2098: error: 'ns_st' undeclared (first use in this function)
../../gcc41/gcc/fortran/module.c:2098: error: (Each undeclared identifier is reported only once
../../gcc41/gcc/fortran/module.c:2098: error: for each function it appears in.)

-- 
Steve



More information about the Fortran mailing list