From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21597 invoked by alias); 20 Sep 2013 09:13:26 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 21535 invoked by uid 48); 20 Sep 2013 09:13:22 -0000 From: "janus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/58099] [4.8/4.9 Regression] [F03] over-zealous procedure-pointer error checking Date: Fri, 20 Sep 2013 09:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: unknown X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: janus at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: janus at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-09/txt/msg01480.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58099 --- Comment #18 from janus at gcc dot gnu.org --- (In reply to janus from comment #17) > (In reply to janus from comment #16) > > TODO: Fix also the issue with PURE/ELEMENTAL reported in comment 14. > > Here is a small patch which does it: This yields a rather large number of failures in the testsuite, due to errors of the type: USE ISO_C_BINDING 1 Error: Cannot change attributes of USE-associated symbol at (1) This is avoided by the following improved patch (which just 'silently' sets the attributes): Index: gcc/fortran/resolve.c =================================================================== --- gcc/fortran/resolve.c (revision 202765) +++ gcc/fortran/resolve.c (working copy) @@ -1679,6 +1679,9 @@ gfc_resolve_intrinsic (gfc_symbol *sym, locus *loc gfc_copy_formal_args_intr (sym, isym); + sym->attr.pure = isym->pure; + sym->attr.elemental = isym->elemental; + /* Check it is actually available in the standard settings. */ if (!gfc_check_intrinsic_standard (isym, &symstd, false, sym->declared_at)) {