This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [Patch, Fortran] PR fortran/37193: USE m, ONLY: i, j => i


Paul Richard Thomas wrote:
Daniel,

Your patch looks OK - however:

Why does the bit of code in module.c(load_needed)....

  mio_symbol (sym);
  sym->attr.use_assoc = 1;
  if (only_flag)
    sym->attr.use_only = 1;
  if (p->u.rsym.renamed)
    sym->attr.use_rename = 1;

return 1;

not do the job? Is it needed now, with your patch?

I've done some tests, and it seemed that


USE m, ONLY: i
USE m, ONLY: j => i

always worked, but that a prior symbol from the same USE didn't have the use_only set and was thus deleted. Your code snippet is, IIRC, from load_needed which is called on all the symbols from one USE after they have all been processed, which is too late for this check. I'm however not sure if there can be other symbols "needed" that are not processed in the list where I set the flag now--this is why I let it as it is.

If you want I can replace the second initialization (the one in your snippet) by an assertion and see if the test-suite still passes and if it does leave the assertion there.

Cheers,
Daniel

--
Done:     Arc-Bar-Cav-Sam-Val-Wiz, Dwa-Elf-Gno-Hum-Orc, Law-Neu-Cha, Fem-Mal
To go:    Hea-Kni-Mon-Pri-Ran-Rog-Tou


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