public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/58676] New: Intrinsic functions not considered pure actual arguments
@ 2013-10-09 22:34 ian_harvey at bigpond dot com
2013-10-10 13:25 ` [Bug fortran/58676] " burnus at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: ian_harvey at bigpond dot com @ 2013-10-09 22:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58676
Bug ID: 58676
Summary: Intrinsic functions not considered pure actual
arguments
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: ian_harvey at bigpond dot com
The following example, when compiled with recent trunk:
MODULE m
IMPLICIT NONE
CONTAINS
SUBROUTINE sub(proc)
INTERFACE
PURE FUNCTION proc(x)
IMPLICIT NONE
REAL, INTENT(IN) :: x
REAL :: proc
END FUNCTION proc
END INTERFACE
PRINT *, proc(0.0)
END SUBROUTINE sub
END MODULE m
PROGRAM p
USE m
IMPLICIT NONE
INTRINSIC :: sin
CALL sub(sin) !xxx
END PROGRAM p
results in an error "Interface mismatch in dummy procedure 'proc' ... :
Mismatch in PURE attribute", which I think (but maybe I've missed something) is
erroneous.
"All standard intrinsic functions are pure" (13.1p2) and "elemental intrinsic
functions may be associated with a dummy procedure (which cannot be elemental)"
(12.5.2.9p1) and `sin` is the relevant bullet-less specific for the generic sin
(13.6).
See also http://software.intel.com/en-us/forums/topic/476356 and perhaps
pr41724.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/58676] Intrinsic functions not considered pure actual arguments
2013-10-09 22:34 [Bug fortran/58676] New: Intrinsic functions not considered pure actual arguments ian_harvey at bigpond dot com
@ 2013-10-10 13:25 ` burnus at gcc dot gnu.org
2013-10-19 6:33 ` quantheory at gmail dot com
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-10-10 13:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58676
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-10-10
CC| |burnus at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Actually, another PR related to this issue is PR58099, which has a patch:
PR58099 comment 18.
That matches the obvious patch which I also just came up with. (I wonder
whether we have to take care whether a specific function exists or not; but
that might be already handled.)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/58676] Intrinsic functions not considered pure actual arguments
2013-10-09 22:34 [Bug fortran/58676] New: Intrinsic functions not considered pure actual arguments ian_harvey at bigpond dot com
2013-10-10 13:25 ` [Bug fortran/58676] " burnus at gcc dot gnu.org
@ 2013-10-19 6:33 ` quantheory at gmail dot com
2013-12-08 21:34 ` burnus at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: quantheory at gmail dot com @ 2013-10-19 6:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58676
Sean Santos <quantheory at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |quantheory at gmail dot com
--- Comment #2 from Sean Santos <quantheory at gmail dot com> ---
*** Bug 58795 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/58676] Intrinsic functions not considered pure actual arguments
2013-10-09 22:34 [Bug fortran/58676] New: Intrinsic functions not considered pure actual arguments ian_harvey at bigpond dot com
2013-10-10 13:25 ` [Bug fortran/58676] " burnus at gcc dot gnu.org
2013-10-19 6:33 ` quantheory at gmail dot com
@ 2013-12-08 21:34 ` burnus at gcc dot gnu.org
2013-12-08 21:35 ` burnus at gcc dot gnu.org
2013-12-09 23:17 ` burnus at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-12-08 21:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58676
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Author: burnus
Date: Sun Dec 8 21:34:18 2013
New Revision: 205791
URL: http://gcc.gnu.org/viewcvs?rev=205791&root=gcc&view=rev
Log:
2013-12-08 Tobias Burnus <burnus@net-b.de>
Janus Weil <janus@gcc.gnu.org>
PR fortran/58099
PR fortran/58676
PR fortran/41724
* resolve.c (gfc_resolve_intrinsic): Set elemental/pure.
(resolve_fl_procedure): Reject pure dummy procedures/procedure
pointers.
(gfc_explicit_interface_required): Don't require a
match of ELEMENTAL for intrinsics.
2013-12-08 Tobias Burnus <burnus@net-b.de>
PR fortran/58099
PR fortran/58676
PR fortran/41724
* gfortran.dg/elemental_subroutine_8.f90: New.
* gfortran.dg/proc_decl_9.f90: Add ELEMENTAL to make valid.
* gfortran.dg/proc_ptr_11.f90: Ditto.
* gfortran.dg/proc_ptr_result_8.f90: Ditto.
* gfortran.dg/proc_ptr_32.f90: Update dg-error.
* gfortran.dg/proc_ptr_33.f90: Ditto.
* gfortran.dg/proc_ptr_result_1.f90: Add abstract interface
which is not elemental.
* gfortran.dg/proc_ptr_result_7.f90: Ditto.
Added:
trunk/gcc/testsuite/gfortran.dg/elemental_subroutine_8.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/proc_decl_9.f90
trunk/gcc/testsuite/gfortran.dg/proc_ptr_11.f90
trunk/gcc/testsuite/gfortran.dg/proc_ptr_32.f90
trunk/gcc/testsuite/gfortran.dg/proc_ptr_33.f90
trunk/gcc/testsuite/gfortran.dg/proc_ptr_result_1.f90
trunk/gcc/testsuite/gfortran.dg/proc_ptr_result_7.f90
trunk/gcc/testsuite/gfortran.dg/proc_ptr_result_8.f90
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/58676] Intrinsic functions not considered pure actual arguments
2013-10-09 22:34 [Bug fortran/58676] New: Intrinsic functions not considered pure actual arguments ian_harvey at bigpond dot com
` (2 preceding siblings ...)
2013-12-08 21:34 ` burnus at gcc dot gnu.org
@ 2013-12-08 21:35 ` burnus at gcc dot gnu.org
2013-12-09 23:17 ` burnus at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-12-08 21:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58676
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
FIXED on the 4.9 trunk.
Thanks for the report!
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/58676] Intrinsic functions not considered pure actual arguments
2013-10-09 22:34 [Bug fortran/58676] New: Intrinsic functions not considered pure actual arguments ian_harvey at bigpond dot com
` (3 preceding siblings ...)
2013-12-08 21:35 ` burnus at gcc dot gnu.org
@ 2013-12-09 23:17 ` burnus at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-12-09 23:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58676
--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Author: burnus
Date: Mon Dec 9 23:17:06 2013
New Revision: 205838
URL: http://gcc.gnu.org/viewcvs?rev=205838&root=gcc&view=rev
Log:
2013-12-10 Tobias Burnus <burnus@net-b.de>
PR fortran/59428
PR fortran/58099
PR fortran/58676
PR fortran/41724
* gfortran.dg/proc_ptr_result_4.f90: Fix proc-ptr interface.
Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/proc_ptr_result_4.f90
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-12-09 23:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-09 22:34 [Bug fortran/58676] New: Intrinsic functions not considered pure actual arguments ian_harvey at bigpond dot com
2013-10-10 13:25 ` [Bug fortran/58676] " burnus at gcc dot gnu.org
2013-10-19 6:33 ` quantheory at gmail dot com
2013-12-08 21:34 ` burnus at gcc dot gnu.org
2013-12-08 21:35 ` burnus at gcc dot gnu.org
2013-12-09 23:17 ` burnus at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).