Commit 1a7bfcc3 by Paul Brook Committed by Paul Brook

trans-expr.c (gfc_conv_expr_present): Fix broken assert.

2005-04-29  Paul Brook   <paul@codesourcery.com>

	* trans-expr.c (gfc_conv_expr_present): Fix broken assert.  Update
	comment.

From-SVN: r98968
parent 21bf822e
2005-04-29 Paul Brook <paul@codesourcery.com>
* trans-expr.c (gfc_conv_expr_present): Fix broken assert. Update
comment.
2005-04-29 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* gfortran.h (gfc_namespace): Add seen_implicit_none field.
......
......@@ -115,14 +115,15 @@ gfc_make_safe_expr (gfc_se * se)
}
/* Return an expression which determines if a dummy parameter is present. */
/* Return an expression which determines if a dummy parameter is present.
Also used for arguments to procedures with multiple entry points. */
tree
gfc_conv_expr_present (gfc_symbol * sym)
{
tree decl;
gcc_assert (sym->attr.dummy && sym->attr.optional);
gcc_assert (sym->attr.dummy);
decl = gfc_get_symbol_decl (sym);
if (TREE_CODE (decl) != PARM_DECL)
......
2005-04-29 Paul Brook <paul@codesourcery.com>
* gfortran.dg/entry_3.f90: New test.
2005-04-29 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* gfortran.dg/implicit_4.f90: New test.
......
! { dg-do run }
! Test assumed shape arrays in procedures with multiple entry points.
! Arguments that aren't present in all entry points must be treated like
! optional arguments.
module entry_4
contains
subroutine foo(a)
integer, dimension(:) :: a
integer, dimension(:) :: b
a = (/1, 2/)
return
entry bar(b)
b = (/3, 4/)
end subroutine
end module
program entry_4_prog
use entry_4
integer :: a(2)
a = 0
call foo(a)
if (any (a .ne. (/1, 2/))) call abort
call bar(a)
if (any (a .ne. (/3, 4/))) call abort
end program
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment