[Bug fortran/36526] pointer in pure function
--- Comment #6 from pault at gcc dot gnu dot org 2008-11-27 22:21 --- Subject: Bug 36526 Author: pault Date: Thu Nov 27 22:20:27 2008 New Revision: 142248 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=142248 Log: 2008-11-27 Paul Thomas [EMAIL PROTECTED] PR fortran/36526 * interface.c (check_intents): Correct error where the actual arg was checked for a pointer argument, rather than the formal. 2008-11-27 Paul Thomas [EMAIL PROTECTED] PR fortran/36526 * gfortran.dg/pure_formal_proc_2.f90: New test. Added: branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/pure_formal_proc_2.f90 Modified: branches/gcc-4_3-branch/gcc/fortran/ChangeLog branches/gcc-4_3-branch/gcc/fortran/interface.c branches/gcc-4_3-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36526
[Bug fortran/36526] pointer in pure function
--- Comment #7 from pault at gcc dot gnu dot org 2008-11-27 22:23 --- Fixed on trunk and 4.3. Thanks for the report. Paul -- pault at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36526
[Bug fortran/36526] pointer in pure function
--- Comment #5 from pault at gcc dot gnu dot org 2008-11-18 10:01 --- (In reply to comment #4) this bug seems fixed in 4.4.0, should it be closed? Joost, I forgot the PR and missed your prompt - I'll apply it to 4.3 and close it. Thanks Paul -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36526
[Bug fortran/36526] pointer in pure function
--- Comment #4 from jv244 at cam dot ac dot uk 2008-08-08 22:23 --- this bug seems fixed in 4.4.0, should it be closed? -- jv244 at cam dot ac dot uk changed: What|Removed |Added Known to work||4.4.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36526
[Bug fortran/36526] pointer in pure function
--- Comment #3 from pault at gcc dot gnu dot org 2008-06-25 23:05 --- Subject: Bug 36526 Author: pault Date: Wed Jun 25 23:04:33 2008 New Revision: 137125 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=137125 Log: 2008-06-25 Paul Thomas [EMAIL PROTECTED] PR fortran/36526 * interface.c (check_intents): Correct error where the actual arg was checked for a pointer argument, rather than the formal. 2008-06-25 Paul Thomas [EMAIL PROTECTED] PR fortran/36526 * gfortran.dg/proc_formal_proc_2.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/pure_formal_proc_2.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36526
[Bug fortran/36526] pointer in pure function
--- Comment #2 from pault at gcc dot gnu dot org 2008-06-20 10:43 --- (In reply to comment #1) This is due to an error in interface.c. The following fixes the fault, bootstraps and regtests OK. I will apply as obvious just as soon as I can. Paul Index: gcc/fortran/interface.c === *** gcc/fortran/interface.c (revision 136870) --- gcc/fortran/interface.c (working copy) *** check_intents (gfc_formal_arglist *f, gf *** 2379,2385 return FAILURE; } ! if (a-expr-symtree-n.sym-attr.pointer) { gfc_error (Procedure argument at %L is local to a PURE procedure and has the POINTER attribute, --- 2379,2385 return FAILURE; } ! if (f-sym-attr.pointer) { gfc_error (Procedure argument at %L is local to a PURE procedure and has the POINTER attribute, -- pault at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |pault at gcc dot gnu dot org |dot org | Status|NEW |ASSIGNED Last reconfirmed|2008-06-13 17:52:34 |2008-06-20 10:43:30 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36526
[Bug fortran/36526] pointer in pure function
--- Comment #1 from burnus at gcc dot gnu dot org 2008-06-13 17:52 --- CONFIRM. Works with other compilers. The constraint checked for is: C1272 In a pure subprogram any designator with a base object that is in common or accessed by host or use association, is a dummy argument of a pure function, is a dummy argument with INTENT (IN) of a pure subroutine, or an object that is storage associated with any such variable, shall not be used in the following contexts: [...] (5) As an actual argument associated with a dummy argument with INTENT (OUT) or INTENT (INOUT) or with the POINTER attribute. (From F2003.) At a glance, it seems as if this applies, but as the non-normative note indicates, C1272 does not apply in this case: NOTE 12.45 Pure subroutines are included to allow subroutine calls from pure procedures in a safe way [...] The constraints for pure subroutines are based on the same principles as for pure functions, except that side effects to INTENT (OUT), INTENT (INOUT), and pointer dummy arguments are permitted. However, I failed to find this in the normative part; I will try a bit more to figure out why C1272 does not apply. -- burnus at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords||rejects-valid Last reconfirmed|-00-00 00:00:00 |2008-06-13 17:52:34 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36526