Patchwork [Fortran] PR 46325 make testcase valid

mail settings
Submitter Tobias Burnus
Date Nov. 11, 2010, 10:39 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/70884/
State New
Headers show


Tobias Burnus - Nov. 11, 2010, 10:39 p.m.
I intent to commit the following patch as obvious. For the background 

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!


2010-11-11  Jakub Jelinek <>
     Tobias Burnus <>

     PR fortran/46325
     * gfortran.dg/char_initialiser_actual.f90: Make test case valid.


diff --git a/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