re PR fortran/23663 (rejects entry point as a value)
PR fortran/23663 * primary.c (match_actual_arg): Handle ENTRY the same way as FUNCTION. * gfortran.fortran-torture/execute/entry_11.f90: New test. From-SVN: r104453
This commit is contained in:
parent
416f403e61
commit
7a4ef45bf4
4 changed files with 47 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
|||
2005-09-20 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR fortran/23663
|
||||
* primary.c (match_actual_arg): Handle ENTRY the same way
|
||||
as FUNCTION.
|
||||
|
||||
2005-09-18 Francois-Xavier Coudert <coudert@clipper.ens.fr>
|
||||
|
||||
* Make-lang.in: Make check-fortran alias for check-gfortran.
|
||||
|
|
|
@ -1324,11 +1324,27 @@ match_actual_arg (gfc_expr ** result)
|
|||
|
||||
/* If the symbol is a function with itself as the result and
|
||||
is being defined, then we have a variable. */
|
||||
if (sym->result == sym
|
||||
&& (gfc_current_ns->proc_name == sym
|
||||
if (sym->attr.function && sym->result == sym)
|
||||
{
|
||||
if (gfc_current_ns->proc_name == sym
|
||||
|| (gfc_current_ns->parent != NULL
|
||||
&& gfc_current_ns->parent->proc_name == sym)))
|
||||
break;
|
||||
&& gfc_current_ns->parent->proc_name == sym))
|
||||
break;
|
||||
|
||||
if (sym->attr.entry
|
||||
&& (sym->ns == gfc_current_ns
|
||||
|| sym->ns == gfc_current_ns->parent))
|
||||
{
|
||||
gfc_entry_list *el = NULL;
|
||||
|
||||
for (el = sym->ns->entries; el; el = el->next)
|
||||
if (sym == el->sym)
|
||||
break;
|
||||
|
||||
if (el)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
e = gfc_get_expr (); /* Leave it unknown for now */
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2005-09-20 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR fortran/23663
|
||||
* gfortran.fortran-torture/execute/entry_11.f90: New test.
|
||||
|
||||
2005-09-20 Dorit Nuzman <dorit@il.ibm.com>
|
||||
|
||||
* gcc.dg/vect/vect-40.c: Remove pointers to "aligned types".
|
||||
|
|
16
gcc/testsuite/gfortran.fortran-torture/execute/entry_11.f90
Normal file
16
gcc/testsuite/gfortran.fortran-torture/execute/entry_11.f90
Normal file
|
@ -0,0 +1,16 @@
|
|||
! PR fortran/23663
|
||||
function i (n)
|
||||
i = n
|
||||
i = max (i, 6)
|
||||
return
|
||||
entry j (n)
|
||||
j = n
|
||||
j = max (j, 3)
|
||||
end
|
||||
|
||||
program entrytest
|
||||
if (i (8).ne.8) call abort
|
||||
if (i (4).ne.6) call abort
|
||||
if (j (0).ne.3) call abort
|
||||
if (j (7).ne.7) call abort
|
||||
end
|
Loading…
Add table
Reference in a new issue