From patchwork Sat Dec 8 09:52:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Fortran] Fix PR 55593 Date: Fri, 07 Dec 2012 23:52:03 -0000 From: Thomas Koenig X-Patchwork-Id: 204643 Message-Id: <50C30DC3.2060208@netcologne.de> To: "fortran@gcc.gnu.org" , gcc-patches Hello world, 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? Thomas 2012-12-08 Thomas Koenig PR fortran/55593 * frontend-passes.c (doloop_code): Use resolved_sym instead of n.sym->formal for formal argument list to get the correct version for all generic subroutines. 2012-12-08 Thomas Koenig PR fortran/55593 * gfortran.dg/do_check_8.f90: New test. Index: frontend-passes.c =================================================================== --- frontend-passes.c (Revision 193793) +++ frontend-passes.c (Arbeitskopie) @@ -1277,8 +1277,12 @@ doloop_code (gfc_code **c, int *walk_subtrees ATTR break; case EXEC_CALL: - f = co->symtree->n.sym->formal; + if (co->resolved_sym == NULL) + break; + + f = co->resolved_sym->formal; + /* Withot a formal arglist, there is only unknown INTENT, which we don't check for. */ if (f == NULL)