public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/58795] New: Specific versions of elemental functions (e.g. sin, dcos) are not pure
@ 2013-10-18 19:53 quantheory at gmail dot com
  2013-10-18 20:47 ` [Bug fortran/58795] " kargl at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: quantheory at gmail dot com @ 2013-10-18 19:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58795

            Bug ID: 58795
           Summary: Specific versions of elemental functions (e.g. sin,
                    dcos) are not pure
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: quantheory at gmail dot com

The Fortran standard doesn't really specify what's going on here, so I've
marked this as an "enhancement", but it could be a helpful change.

In the attached program, the "eval" function can't run on the specific version
of the intrinsic sin function because it's not pure, but it can run on a
user-defined pure function that's nothing more than a wrapper for the elemental
intrinsic. This was a mild annoyance when I was writing some "functional" tools
(e.g. integration routines that take a user-defined function) and tried to test
on the intrinsic sin/cos.

If the specific intrinsics were made pure, that would fix the issue. This could
break backwards compatibility for programs that do this:

intrinsic :: sin
procedure(sin) :: f

That would be a problem if the author didn't want to give "f" the "pure"
attribute. However, I doubt that there are many programs that try to use the
intrinsics to avoid writing their own interface blocks.

For any other situation I can think of, adding "pure" to the specific
intrinsics can only be a benefit.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/58795] Specific versions of elemental functions (e.g. sin, dcos) are not pure
  2013-10-18 19:53 [Bug fortran/58795] New: Specific versions of elemental functions (e.g. sin, dcos) are not pure quantheory at gmail dot com
@ 2013-10-18 20:47 ` kargl at gcc dot gnu.org
  2013-10-19  5:43 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: kargl at gcc dot gnu.org @ 2013-10-18 20:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58795

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #1 from kargl at gcc dot gnu.org ---
There isn't an attached example.  But, the Fortran standard states

F2008:p. 315
All standard intrinsic functions are pure.

It isn't at all clear what you mean.  I do note that the standard
further states

F2008: p. 315
If an intrinsic procedure is used as an actual argument to a procedure,
its specific name shall be used and it may be referenced in the called
procedure only with scalar arguments.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/58795] Specific versions of elemental functions (e.g. sin, dcos) are not pure
  2013-10-18 19:53 [Bug fortran/58795] New: Specific versions of elemental functions (e.g. sin, dcos) are not pure quantheory at gmail dot com
  2013-10-18 20:47 ` [Bug fortran/58795] " kargl at gcc dot gnu.org
@ 2013-10-19  5:43 ` burnus at gcc dot gnu.org
  2013-10-19  6:32 ` quantheory at gmail dot com
  2013-10-19  6:33 ` quantheory at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-10-19  5:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58795

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Isn't this PR the same as PR58676 and - related - PR58099 (esp. PR58099 comment
18)?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/58795] Specific versions of elemental functions (e.g. sin, dcos) are not pure
  2013-10-18 19:53 [Bug fortran/58795] New: Specific versions of elemental functions (e.g. sin, dcos) are not pure quantheory at gmail dot com
  2013-10-18 20:47 ` [Bug fortran/58795] " kargl at gcc dot gnu.org
  2013-10-19  5:43 ` burnus at gcc dot gnu.org
@ 2013-10-19  6:32 ` quantheory at gmail dot com
  2013-10-19  6:33 ` quantheory at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: quantheory at gmail dot com @ 2013-10-19  6:32 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58795

--- Comment #3 from Sean Santos <quantheory at gmail dot com> ---
That's what I get for trying to rush through the report before leaving on
Friday. This is indeed a duplicate of PR58676, and my missing attachment was
essentially the same as the test case there.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/58795] Specific versions of elemental functions (e.g. sin, dcos) are not pure
  2013-10-18 19:53 [Bug fortran/58795] New: Specific versions of elemental functions (e.g. sin, dcos) are not pure quantheory at gmail dot com
                   ` (2 preceding siblings ...)
  2013-10-19  6:32 ` quantheory at gmail dot com
@ 2013-10-19  6:33 ` quantheory at gmail dot com
  3 siblings, 0 replies; 5+ 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=58795

Sean Santos <quantheory at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #4 from Sean Santos <quantheory at gmail dot com> ---
Marking duplicate.

*** This bug has been marked as a duplicate of bug 58676 ***


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-10-19  6:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-18 19:53 [Bug fortran/58795] New: Specific versions of elemental functions (e.g. sin, dcos) are not pure quantheory at gmail dot com
2013-10-18 20:47 ` [Bug fortran/58795] " kargl at gcc dot gnu.org
2013-10-19  5:43 ` burnus at gcc dot gnu.org
2013-10-19  6:32 ` quantheory at gmail dot com
2013-10-19  6:33 ` quantheory at gmail dot com

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).