This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran] PR 36704/38290
- From: Daniel Kraft <d at domob dot eu>
- To: Janus Weil <jaydub66 at googlemail dot com>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 01 Dec 2008 14:38:22 +0100
- Subject: Re: [Patch, Fortran] PR 36704/38290
- References: <854832d40812010506t1d1df32brfb7a0b1fe2c15c99@mail.gmail.com>
Hi Janus,
Janus Weil wrote:
this patch fixes two PRs (at least partially):
* PR 36704 - Procedure pointer as function result: This I was planning
to implement in 4.5, but when having a look at it over the weekend, I
found that certain cases (i.e. those using a RESULT statement, see
proc_ptr_12.f90) are really easy to implement, so maybe this could
still go into 4.4 (since it's more of a bugfix than a 'feature')? The
harder cases (without RESULT statement) I will then take care of
later.
* PR 38290 - Procedure pointer assignment checking: This adds a few
additional checks for procedure pointer assignments and fixes comment
#2 from the PR, including an ICE, so it's even a 4.4 regression.
From my point of view, those should be both ok.
- if (gfc_add_flavor (&r->attr, FL_VARIABLE, r->name, NULL) == FAILURE
- || gfc_add_result (&r->attr, r->name, NULL) == FAILURE)
+ if (gfc_add_result (&r->attr, r->name, NULL) == FAILURE)
return MATCH_ERROR;
Adding flavour FL_VARIABLE goes here without replacement (of course, it
need to), but why was it needed in the first place? Could this harm
somehow?
- if (sym->attr.flavor == FL_UNKNOWN) sym->attr.flavor = FL_PROCEDURE;
Ditto. What happens if the flavour is FL_UNKNOWN and would have been
set to PROCEDURE? Why is this simply not needed?
Cheers,
Daniel
--
Done: Arc-Bar-Cav-Rog-Sam-Val-Wiz
To go: Hea-Kni-Mon-Pri-Ran-Tou