Commit 64300da7 by Steven G. Kargl

re PR fortran/78741 (ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1534)

2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78741
	* decl.c (get_proc_name):  Check for clash of entry name with
	subroutine name.

2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78741
	* gfortran.dg/pr78741.f90: New test.

From-SVN: r258581
parent 93d1ab50
2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78741
* decl.c (get_proc_name): Check for clash of entry name with
subroutine name.
2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/69395
* decl.c (merge_array_spec): Limit the merging to maximum allowed
dimensions, and issue error message if limit is exceeded.
......
......@@ -1209,11 +1209,16 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry)
accessible names. */
if (sym->attr.flavor != 0
&& sym->attr.proc != 0
&& (sym->attr.subroutine || sym->attr.function)
&& (sym->attr.subroutine || sym->attr.function || sym->attr.entry)
&& sym->attr.if_source != IFSRC_UNKNOWN)
gfc_error_now ("Procedure %qs at %C is already defined at %L",
name, &sym->declared_at);
if (sym->attr.flavor != 0
&& sym->attr.entry && sym->attr.if_source != IFSRC_UNKNOWN)
gfc_error_now ("Procedure %qs at %C is already defined at %L",
name, &sym->declared_at);
/* Trap a procedure with a name the same as interface in the
encompassing scope. */
if (sym->attr.generic != 0
......
2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78741
* gfortran.dg/pr78741.f90: New test.
2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/69395
* gfortran.dg/pr69395.f90: New test.
......
! { dg-do compile }
! PR fortran/78741
! Contributed by Gerhard Steinmetz <gerhard.steinmetz.fortran at t-online.de>
subroutine s(n, x)
integer :: n
character(n) :: x
character, pointer :: z(:)
x = 'a'
return
entry g(n, x) ! { dg-error "is already defined" }
x = 'b'
contains
subroutine g ! { dg-error "(1)" }
z(1) = x(1:1)
end
end
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