This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[Patch,Fortran] PR 46325 make testcase valid
- From: Tobias Burnus <burnus at net-b dot de>
- To: gcc patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Thu, 11 Nov 2010 23:39:57 +0100
- Subject: [Patch,Fortran] PR 46325 make testcase valid
I intent to commit the following patch as obvious. For the background
see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46325
Short version: The test case is invalid as the effective argument to
"pfoo" does not have the target attribute. (It is an array constructor.)
Thus, the pointer association status of the return value of "pfoo" is
undefined. Solution: Make sure the value remains defined.
The issue was analysed by Jakub. Thanks!
Tobias
2010-11-11 Jakub Jelinek <jakub@redhat.com>
Tobias Burnus <burnus@net-b.de>
PR fortran/46325
* gfortran.dg/char_initialiser_actual.f90: Make test case valid.
diff --git a/gcc/testsuite/gfortran.dg/char_initialiser_actual.f90
b/gcc/testsuite/gfortran.dg/char_initialiser_actual.f90
index d123aca..dbd7890 100644
--- a/gcc/testsuite/gfortran.dg/char_initialiser_actual.f90
+++ b/gcc/testsuite/gfortran.dg/char_initialiser_actual.f90
@@ -24,6 +24,7 @@ contains
function pfoo(ch2)
character*5, dimension(:), target :: ch2
character*5, dimension(:), pointer :: pfoo
- pfoo => ch2
+ allocate(pfoo(size(ch2)))
+ pfoo = ch2
end function pfoo
end program