re PR fortran/30873 ([4.1 only] ENTRY without explict RESULT does not work for recursive functions)

2007-03-08  Paul Thomas  <pault@gcc.gnu.org>
            Tobias Burnus  <burnus@net-b.de>

        PR fortran/30873
        * decl.c (gfc_match_entry): Remove erroneous entry result check.

2007-03-08  Paul Thomas  <pault@gcc.gnu.org>
            Tobias Burnus  <burnus@net-b.de>

        PR fortran/30873
        * gfortran.dg/entry_9.f90: New test.


Co-Authored-By: Tobias Burnus <burnus@net-b.de>

From-SVN: r122711
This commit is contained in:
Paul Thomas
2007-03-08 21:06:37 +00:00
committed by Tobias Burnus
parent de73fd96d0
commit e0857aa75d
4 changed files with 43 additions and 6 deletions

View File

@@ -1,3 +1,9 @@
2007-03-08 Paul Thomas <pault@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
PR fortran/30873
* decl.c (gfc_match_entry): Remove erroneous entry result check.
2007-03-06 Daniel Franke <franke.daniel@gmail.com>
Backport from trunk:

View File

@@ -2887,12 +2887,6 @@ gfc_match_entry (void)
entry->result = result;
}
if (proc->attr.recursive && result == NULL)
{
gfc_error ("RESULT attribute required in ENTRY statement at %C");
return MATCH_ERROR;
}
}
if (gfc_match_eos () != MATCH_YES)

View File

@@ -1,3 +1,9 @@
2007-03-08 Paul Thomas <pault@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
PR fortran/30873
* gfortran.dg/entry_9.f90: New test.
2007-03-08 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/30981

View File

@@ -0,0 +1,31 @@
! { dg-do "run" }
! Check whether RESULT of ENTRY defaults to entry-name.
! PR fortran/30873
!
! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
!
MODULE M1
CONTAINS
FUNCTION F2(K)
INTEGER :: F2,K
F2=E1(K)
END FUNCTION F2
RECURSIVE FUNCTION F1(I)
INTEGER :: F1,I,E1
F1=F2(I)
RETURN
ENTRY E1(I)
E1=-I
RETURN
END FUNCTION F1
END MODULE M1
program main
use m1
if (E1(5) /= -5) call abort()
if (F2(4) /= -4) call abort()
if (F1(1) /= -1) call abort()
end program main
! { dg-final { cleanup-modules "m1" } }