diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2018-02-23 17:55:13 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2018-02-23 17:55:13 +0000 |
commit | 1996c75efdf29aad3f9910207cc900ff621748ba (patch) | |
tree | 344356fea43ba7c216c4216f5675cd2f73c78aab /gcc | |
parent | c6839134ee53c7ee582145c7fb41f20305bf58cf (diff) | |
download | gcc-1996c75efdf29aad3f9910207cc900ff621748ba.zip gcc-1996c75efdf29aad3f9910207cc900ff621748ba.tar.gz gcc-1996c75efdf29aad3f9910207cc900ff621748ba.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-types.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr83149_a.f90 | 11 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr83149_b.f90 | 16 |
5 files changed, 40 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 60469d0..528d294 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,6 +1,12 @@ 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. diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index 697b735..20de203 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6cfcb11..d68abc5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +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, diff --git a/gcc/testsuite/gfortran.dg/pr83149_a.f90 b/gcc/testsuite/gfortran.dg/pr83149_a.f90 new file mode 100644 index 0000000..3f15198 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr83149_a.f90 @@ -0,0 +1,11 @@ +! 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 + diff --git a/gcc/testsuite/gfortran.dg/pr83149_b.f90 b/gcc/testsuite/gfortran.dg/pr83149_b.f90 new file mode 100644 index 0000000..f67ffd9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr83149_b.f90 @@ -0,0 +1,16 @@ +! 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 |