From a6906c809772feaead79e533e79535bd03a49aa6 Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Fri, 30 Oct 2015 19:20:36 +0000 Subject: [PATCH] re PR fortran/46588 (ICE with assumed character length function) 2015-10-30 Steven G. Kargl PR fortran/46588 * gfortran.dg/pr46588.f90: New test. From-SVN: r229606 --- gcc/testsuite/ChangeLog | 7 ++++++- gcc/testsuite/gfortran.dg/pr46588.f90 | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/pr46588.f90 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 32c6a904770..a82f4cb2f5e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-10-30 Steven G. Kargl + + PR fortran/46588 + * gfortran.dg/pr46588.f90: New test. + 2015-10-30 Evgeny Stupachenko * gcc.dg/mvc1.c: New test for multiple targets cloning. @@ -12,7 +17,7 @@ * g++.dg/ext/mvc3.C: Ditto. * g++.dg/ext/mvc4.C: Ditto. -2015-10-15 Steven G. Kargl +2015-10-30 Steven G. Kargl PR fortran/51993 * gfortran.dg/pr51993.f90: New test. diff --git a/gcc/testsuite/gfortran.dg/pr46588.f90 b/gcc/testsuite/gfortran.dg/pr46588.f90 new file mode 100644 index 00000000000..420fb4b2e90 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr46588.f90 @@ -0,0 +1,21 @@ +! { dg-do run } +! { dg-options "-std=gnu" } +! PR fortran/46588 +! Original code contributed by Oleh Steblev +! +! Issue appears to be fixed by PR 67805/68108 +function aufun(pm) + character(len = *) pm + character(len = *) aufun + character(len = len(aufun)) temp + temp = pm + aufun = 'Oh' // trim(temp) +end function aufun + +program ds + implicit none + character(len = 4) :: ins = ' no!' + character(len = 20) st, aufun + st = aufun(ins) + if (trim(st) /= 'Oh no!') call abort +end -- 2.30.2