public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/37779]  New: Missing RECURSIVE not detected
@ 2008-10-09  7:10 burnus at gcc dot gnu dot org
  2008-11-15  8:32 ` [Bug fortran/37779] " domob at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-10-09  7:10 UTC (permalink / raw)
  To: gcc-bugs

Found at
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/70dd268bac2af9c9

The following program should be rejected as NAG f95,
  Error: line 4: Subroutine FOO is not RECURSIVE
, and ifort,
  error #6437: A subroutine or function is calling itself recursively.   [FOO]
, do.

      subroutine foo(x)
      real, intent(in) :: x

      call bar(x,foo)

      return
      end subroutine foo


-- 
           Summary: Missing RECURSIVE not detected
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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

* [Bug fortran/37779] Missing RECURSIVE not detected
  2008-10-09  7:10 [Bug fortran/37779] New: Missing RECURSIVE not detected burnus at gcc dot gnu dot org
@ 2008-11-15  8:32 ` domob at gcc dot gnu dot org
  2008-11-22 19:04 ` burnus at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: domob at gcc dot gnu dot org @ 2008-11-15  8:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from domob at gcc dot gnu dot org  2008-11-15 08:30 -------
I'll take this one on.  Reading quickly through the thread gives me the
impression that it is not 100% agreed upon that this should in every case be an
error (although of course nearly so).  But I guess we want to reject it
anyways, don't we?

Or should we do something like warn on std=gnu and reject for std=f95?


-- 

domob at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |domob at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-11-15 08:30:57
               date|                            |


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


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

* [Bug fortran/37779] Missing RECURSIVE not detected
  2008-10-09  7:10 [Bug fortran/37779] New: Missing RECURSIVE not detected burnus at gcc dot gnu dot org
  2008-11-15  8:32 ` [Bug fortran/37779] " domob at gcc dot gnu dot org
@ 2008-11-22 19:04 ` burnus at gcc dot gnu dot org
  2008-11-22 21:42 ` burnus at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-11-22 19:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2008-11-22 19:03 -------
Another code which is not rejected. If the parent procedure is called by a
contained procedure there must be a recursion:

subroutine test()
  call sub()
contains
  subroutine sub()
    call test()
  end subroutine sub
end subroutine test

NAG f95 detects this:

Error: hfjf.f90, line 7: Invalid recursive self-reference to TEST

as does openf95:

openf95-343 openf95: ERROR SUB, File = hfjf.f90, Line = 5, Column = 10
  A RECURSIVE keyword must be declared for a subprogram so that the subprogram
can be called recursively.

ifort, g95 and gfortran accept this program. (Can be also moved into a
different PR.)


-- 


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


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

* [Bug fortran/37779] Missing RECURSIVE not detected
  2008-10-09  7:10 [Bug fortran/37779] New: Missing RECURSIVE not detected burnus at gcc dot gnu dot org
  2008-11-15  8:32 ` [Bug fortran/37779] " domob at gcc dot gnu dot org
  2008-11-22 19:04 ` burnus at gcc dot gnu dot org
@ 2008-11-22 21:42 ` burnus at gcc dot gnu dot org
  2008-11-24 13:13 ` domob at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-11-22 21:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2008-11-22 21:40 -------
Before closing, one should check whether a recursive-related bug remains for
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/e0d04d755453a2a5


-- 


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


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

* [Bug fortran/37779] Missing RECURSIVE not detected
  2008-10-09  7:10 [Bug fortran/37779] New: Missing RECURSIVE not detected burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-11-22 21:42 ` burnus at gcc dot gnu dot org
@ 2008-11-24 13:13 ` domob at gcc dot gnu dot org
  2008-11-30 20:38 ` domob at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: domob at gcc dot gnu dot org @ 2008-11-24 13:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from domob at gcc dot gnu dot org  2008-11-24 13:12 -------
Subject: Bug 37779

Author: domob
Date: Mon Nov 24 13:10:37 2008
New Revision: 142158

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142158
Log:
2008-11-24  Daniel Kraft  <d@domob.eu>

        PR fortran/37779
        * resolve.c (resolve_procedure_expression): New method.
        (resolve_variable): Call it.
        (resolve_actual_arglist): Call gfc_resolve_expr for procedure
arguments.

2008-11-24  Daniel Kraft  <d@domob.eu>

        PR fortran/37779
        * gfortran.dg/c_funloc_tests.f03: Added missing `RECURSIVE'.
        * gfortran.dg/c_funloc_tests_2.f03: Ditto.
        * gfortran.dg/recursive_check_4.f03: New test.
        * gfortran.dg/recursive_check_5.f03: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/recursive_check_4.f03
    trunk/gcc/testsuite/gfortran.dg/recursive_check_5.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/c_funloc_tests.f03
    trunk/gcc/testsuite/gfortran.dg/c_funloc_tests_2.f03


-- 


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


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

* [Bug fortran/37779] Missing RECURSIVE not detected
  2008-10-09  7:10 [Bug fortran/37779] New: Missing RECURSIVE not detected burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-11-24 13:13 ` domob at gcc dot gnu dot org
@ 2008-11-30 20:38 ` domob at gcc dot gnu dot org
  2008-11-30 20:41 ` domob at gcc dot gnu dot org
  2008-12-01  7:28 ` domob at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: domob at gcc dot gnu dot org @ 2008-11-30 20:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from domob at gcc dot gnu dot org  2008-11-30 20:37 -------
Subject: Bug 37779

Author: domob
Date: Sun Nov 30 20:36:10 2008
New Revision: 142299

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142299
Log:
2008-11-30  Daniel Kraft  <d@domob.eu>

        PR fortran/37779
        * gfortran.h (struct gfc_entry_list): Fixed typo in comment.
        * resolve.c (is_illegal_recursion): New method.
        (resolve_procedure_expression): Use new is_illegal_recursion instead of
        direct check and handle function symbols correctly.
        (resolve_actual_arglist): Removed useless recursion check.
        (resolve_function): Use is_illegal_recursion instead of direct check.
        (resolve_call): Ditto.

2008-11-30  Daniel Kraft  <d@domob.eu>

        PR fortran/37779
        * gfortran.dg/recursive_check_1.f: Changed expected error message to
        the more general new one.
        * gfortran.dg/recursive_check_2.f90: Ditto.
        * gfortran.dg/entry_18.f90: Ditto.
        * gfortran.dg/recursive_check_4.f03: Do "the same" check also for
        FUNCTIONS, as this is different in details from SUBROUTINES.
        * gfortran.dg/recursive_check_6.f03: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/recursive_check_6.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/entry_18.f90
    trunk/gcc/testsuite/gfortran.dg/recursive_check_1.f
    trunk/gcc/testsuite/gfortran.dg/recursive_check_2.f90
    trunk/gcc/testsuite/gfortran.dg/recursive_check_4.f03


-- 


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


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

* [Bug fortran/37779] Missing RECURSIVE not detected
  2008-10-09  7:10 [Bug fortran/37779] New: Missing RECURSIVE not detected burnus at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-11-30 20:38 ` domob at gcc dot gnu dot org
@ 2008-11-30 20:41 ` domob at gcc dot gnu dot org
  2008-12-01  7:28 ` domob at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: domob at gcc dot gnu dot org @ 2008-11-30 20:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from domob at gcc dot gnu dot org  2008-11-30 20:40 -------
This second commit detects cases like the one mentioned by Tobias in comment #2
on trunk/4.4  I'm going to work on a optional runtime-recursion checking
feature now as last part for this PR.


-- 


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


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

* [Bug fortran/37779] Missing RECURSIVE not detected
  2008-10-09  7:10 [Bug fortran/37779] New: Missing RECURSIVE not detected burnus at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-11-30 20:41 ` domob at gcc dot gnu dot org
@ 2008-12-01  7:28 ` domob at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: domob at gcc dot gnu dot org @ 2008-12-01  7:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from domob at gcc dot gnu dot org  2008-12-01 07:27 -------
Closing, for runtime-recursion checking I accepted PR 32626.


-- 

domob at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2008-12-01  7:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-09  7:10 [Bug fortran/37779] New: Missing RECURSIVE not detected burnus at gcc dot gnu dot org
2008-11-15  8:32 ` [Bug fortran/37779] " domob at gcc dot gnu dot org
2008-11-22 19:04 ` burnus at gcc dot gnu dot org
2008-11-22 21:42 ` burnus at gcc dot gnu dot org
2008-11-24 13:13 ` domob at gcc dot gnu dot org
2008-11-30 20:38 ` domob at gcc dot gnu dot org
2008-11-30 20:41 ` domob at gcc dot gnu dot org
2008-12-01  7:28 ` domob at gcc dot gnu dot 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).