diff options
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/entry_9.f90 | 31 |
4 files changed, 43 insertions, 6 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 9cd70d4de5a..afd9d26b655 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2007-03-02 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-01 Brooks Moses <brooks.moses@codesourcery.com> * Make-lang.in: Add install-pdf target as copied from diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index aaa11572ade..f6ffc1df7fe 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -3030,12 +3030,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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cc6e940c5ca..e87707c90d2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2007-03-02 Paul Thomas <pault@gcc.gnu.org> + Tobias Burnus <burnus@net-b.de> + + PR fortran/30873 + * gfortran.dg/entry_9.f90: New test. + 2007-03-02 Simon Martin <simartin@users.sourceforge.net> PR c++/28253 diff --git a/gcc/testsuite/gfortran.dg/entry_9.f90 b/gcc/testsuite/gfortran.dg/entry_9.f90 new file mode 100644 index 00000000000..1daf49ce621 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/entry_9.f90 @@ -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" } } |