This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR32634 -- reverted patch, gfortran.dg/interface_16.f90 failure


Tobias,

gcc/fortran/module.c: In function 'read_module': gcc/fortran/module.c:3465: error: 'sym' may be used uninitialized in this function

We have:
  gfc_symbol *sym; [...]
  while (peek_atom () != ATOM_RPAREN)
    { [...]
      sym = find_true_name (info->u.rsym.true_name, info->u.rsym.module);
    } [...]
  while (peek_atom () != ATOM_RPAREN)
    { [...]
          mio_symbol_interface (&sym->name, &sym->module, &sym->generic);

I don't quickly see whether gcc is overly strict or right.

Tobias
I don't see quite what you have done. The updated write_generic is

static void
write_generic (gfc_symbol *sym)
{
 const char *p;
 int nuse, j;

 if (sym->generic == NULL
     || !gfc_check_access (sym->attr.access, sym->ns->default_access))
   return;

 if (sym->module == NULL)
   sym->module = gfc_get_string (module_name);

 /* See how many use names there are.  If none, use the symbol name.  */
 nuse = number_use_names (sym->name);
 if (nuse == 0)
   {
     mio_symbol_interface (&sym->name, &sym->module, &sym->generic);
     return;
   }

 for (j = 1; j <= nuse; j++)
   {
     /* Get the jth local name for this symbol.  */
     p = find_use_name_n (sym->name, &j);

     mio_symbol_interface (&p, &sym->module, &sym->generic);
   }
}

As you can see, you cannot have applied the patch to the write place. The whitespace is due to cutting and pasting from Windows, just to get the message out of the door.

I have bootstrapped and regtested on x86_ia64/FC5 ... and I committed it because I simply will not have any other opportunity for a while.

Enjoy.

Paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]