Commit 1996c75e by Paul Thomas

re PR fortran/83149 ([6- and 7-branches] Missing test for sym->ns->proc_name:…

re PR fortran/83149 ([6- and 7-branches] Missing test for sym->ns->proc_name: crash_signal in toplev.c:325)

2018-02-23  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83149
	* trans-types.c (gfc_sym_type): Test sym->ns->proc_name before
	accessing its components.

2018-02-23  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83149
	* gfortran.dg/pr83149_b.f90: New test.
	* gfortran.dg/pr83149_a.f90: Additional source for previous.

From-SVN: r257938
parent c6839134
2018-02-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83149
* trans-types.c (gfc_sym_type): Test sym->ns->proc_name before
accessing its components.
2018-02-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83149
* trans-decl.c (gfc_finish_var_decl): Test sym->ns->proc_name
before accessing its components.
......
......@@ -2251,6 +2251,7 @@ gfc_sym_type (gfc_symbol * sym)
if (sym->attr.result
&& sym->ts.type == BT_CHARACTER
&& sym->ts.u.cl->backend_decl == NULL_TREE
&& sym->ns->proc_name
&& sym->ns->proc_name->ts.u.cl->backend_decl != NULL_TREE)
sym->ts.u.cl->backend_decl = sym->ns->proc_name->ts.u.cl->backend_decl;
......
2018-02-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83149
* gfortran.dg/pr83149_b.f90: New test.
* gfortran.dg/pr83149_a.f90: Additional source for previous.
2018-02-23 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/builtins-3-runnable.c: Move tests for vec_float2,
......
! Compiled with pr83149_b.f90
!
module mod
character(8) string
contains
function get_string() result(s)
character(len_trim(string)) s
s = string
end function
end module
! Compiled with pr83149_a.f90
! { dg-do run }
! { dg-options "-fno-whole-file" }
! { dg-compile-aux-modules "pr83149_a.f90" }
! { dg-additional-sources pr83149_a.f90 }
!
! Contributed by Neil Carlson <neil.n.carlson@gmail.com>
!
use mod
string = 'fubar'
select case (get_string())
case ('fubar')
case default
stop 1
end select
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