From ceeb79a48e25f19f6242e1ac281883a07dd1d2f1 Mon Sep 17 00:00:00 2001 From: Mikael Morin Date: Thu, 7 Jul 2011 23:03:25 +0200 Subject: [PATCH] re PR fortran/49648 (ICE(segfault) with MATMUL and function-result actual argument) 2011-07-07 Mikael Morin PR fortran/49648 * gfortran.dg/result_in_spec_4.f90: New test. From-SVN: r176012 --- gcc/testsuite/ChangeLog | 5 ++++ .../gfortran.dg/result_in_spec_4.f90 | 27 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/result_in_spec_4.f90 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 63dda0097c3..c57cb97105f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-07-07 Mikael Morin + + PR fortran/49648 + * gfortran.dg/result_in_spec_4.f90: New test. + 2011-07-07 Rainer Orth * gcc.target/sparc/cas64.c: New test. diff --git a/gcc/testsuite/gfortran.dg/result_in_spec_4.f90 b/gcc/testsuite/gfortran.dg/result_in_spec_4.f90 new file mode 100644 index 00000000000..3f0e9a37910 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/result_in_spec_4.f90 @@ -0,0 +1,27 @@ +! { dg-do compile } +! +! PR fortran/49648 +! ICE for calls to a use-associated function returning an array whose spec +! depends on a function call. + +! Contributed by Tobias Burnus + +module m2 + COMPLEX, SAVE, ALLOCATABLE :: P(:) +contains + FUNCTION getPhaseMatrix() RESULT(PM) + COMPLEX:: PM(SIZE(P),3) + PM=0.0 + END FUNCTION +end module m2 + +module m + use m2 +contains + SUBROUTINE gf_generateEmbPot() + COMPLEX :: sigma2(3,3) + sigma2 = MATMUL(getPhaseMatrix(), sigma2) + END SUBROUTINE +end module m + +! { dg-final { cleanup-modules "m m2" } } -- 2.30.2