This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran] PR fortran/35837: Fix type-resolving and gfc_current_ns
- From: Daniel Kraft <d at domob dot eu>
- To: Fortran List <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 05 Sep 2008 19:43:33 +0200
- Subject: Re: [Patch, Fortran] PR fortran/35837: Fix type-resolving and gfc_current_ns
- References: <48C15E82.6080709@domob.eu>
Daniel Kraft wrote:
Hi,
resolve_types used to set gfc_current_ns to the namespace resolved, but
did not reset the value on exit; for nested namespaces and the test in
PR 35837, this lead to the result that gfc_save_all/gfc_add_save was
called for the module's namespace, while gfc_current_ns still pointed to
the (resolved from module's resolve_types prior to the save_all call?)
pure procedure's namespace and thus the compiler complained about the
SAVE for a pure procedure.
This patch fixes this problem by remembering the old namespace and
resetting it on exit for resolve_types. I believe this is generally a
good idea, though, and just happens to fix this PR.
Currently regression testing on GNU/Linux-x86-32, and I hope there won't
be any despite this might have some consequences; but I hope all are
positive :) Ok to commit if no regressions?
No regressions.
Daniel
PS: The gfc_save_all change remained from some experiments there; I can
take it out if you prefer. Should I add a ChangeLog entry like "removed
blank line"?
--
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