This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, Fortran] Fix PR 55593
- From: Janus Weil <janus at gcc dot gnu dot org>
- To: Thomas Koenig <tkoenig at netcologne dot de>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 8 Dec 2012 17:39:19 +0100
- Subject: Re: [patch, Fortran] Fix PR 55593
- References: <50C30DC3.2060208@netcologne.de>
Hi Thomas,
> the attached patch fixes a regression introduced with the recent
> checking for DO loop variables when they are used with a generic
> subroutine where the generic name matches one of the actual names.
>
> Regression-tested. OK for trunk?
A few questions about that patch:
- f = co->symtree->n.sym->formal;
+ if (co->resolved_sym == NULL)
+ break;
+
+ f = co->resolved_sym->formal;
In which cases does it happen that "resolved_sym==NULL" ? Would it
make sense to do the following instead?
if (co->resolved_sym)
f = co->resolved_sym->formal;
else
f = co->symtree->n.sym->formal;
Or could we even use an "gfc_assert (co->resolved_sym)"?
Cheers,
Janus