This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, fortran] PR37445 - Host-associated proc not found if same-name generic is use-associated
- From: Tobias Burnus <burnus at net-b dot de>
- To: Paul Thomas <paul dot richard dot thomas at gmail dot com>
- Cc: gcc-patch at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Sun, 02 Nov 2008 22:35:31 +0100
- Subject: Re: [Patch, fortran] PR37445 - Host-associated proc not found if same-name generic is use-associated
- References: <20080929220844.GA17009@net-b.de> <490E0D7E.1030201@gmail.com>
Paul,
Paul Thomas wrote:
> The regression is now fixed in the attached. The original patch
> failed to check if the new subroutine symbol is really contained in
> the current namespace. Once the extra line is added, Norman's
> original 80 file source code compiles correctly.... or it compiles, at
> least:-)
Thanks! That's great.
> The patch also contains a proposal for PR35769 - I have no fixed
> thoughts on this other than that it might be excessively difficult to
> fix it properly. If this does not immediately seem good, forget it:-)
>
I think it is good (enough). I'm not sure whether the warning is clear:
Warning: The FORALL with index 'j2' might cause more than one assignment
to this object at (1)
ifort has:
warning #6696: All active combinations of index-names are not used
within the variable being defined (i.e., leftside) of this
assignment-stmt. [LDA]
(Note: ifort miscompiles the program with -O2.)
g95 has:
Error: Left side of assignment at (1) in FORALL block must contain the
'j2' iterator
(note: Error is wrong)
I'm not sure whether one can improve the wording; I like g95's one
(without "must") a bit more. One could combine them, e.g to
"Warning: The FORALL with index 'j2' is not used on the left side of the
assignment at (1) which might cause more than one assignment to this object"
which has the disadvantage of being lengthy.
> Bootstrapped and regtested on FC9/x86_i64 - OK for trunk and, after a
> week, for 4.3?
Regarding:
/* If one of the FORALL index variables doesn't appear in the
assignment target, then there will be a many-to-one
assignment. */
if (find_forall_index (code->expr, forall_index, 0) == FAILURE)
gfc_warning ("The FORALL with index '%s' might cause more than "
"one assignment to this object at %L",
var_expr[n]->symtree->name, &code->expr->where);
a) In the comment s/will be/might be/
b) Maybe you can come up with a slightly clearer warning message.
Otherwise: OK. Thanks for the patch.
Tobias