This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]