]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/43985 (ICE when assumed size cray-pointee passed as argument)
authorTobias Burnus <burnus@net-b.de>
Wed, 5 May 2010 22:11:14 +0000 (00:11 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Wed, 5 May 2010 22:11:14 +0000 (00:11 +0200)
2010-05-06  Tobias Burnus  <burnus@net-b.de>

        PR fortran/43985
        * trans-types.c (gfc_sym_type): Mark Cray pointees as
        GFC_POINTER_TYPE_P.

2010-05-06  Tobias Burnus  <burnus@net-b.de>

        PR fortran/43985
        * gfortran.dg/gomp/crayptr5.f90: New test case.

From-SVN: r159086

gcc/fortran/ChangeLog
gcc/fortran/trans-types.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/gomp/crayptr5.f90 [new file with mode: 0644]

index 5b6b42f8a804ef823e107773f1be10a805f40e4d..8580997fb4c70d8820f55c0ae597be90caeb400c 100644 (file)
@@ -1,7 +1,13 @@
+2010-05-0  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/43985
+       * trans-types.c (gfc_sym_type): Mark Cray pointees as
+       GFC_POINTER_TYPE_P.
+
 2010-05-05  Daniel Franke  <franke.daniel@gmail.com>
 
-        * resolve.c (traverse_data_list): Rephrase error message for
-        non-constant bounds in data-implied-do.
+       * resolve.c (traverse_data_list): Rephrase error message for
+       non-constant bounds in data-implied-do.
 
 2010-05-05  Daniel Franke  <franke.daniel@gmail.com>
 
index 31a250d0de761e09c24a719a7723b12b6355573c..dca19ce90b65af49a4705e23a6e636a2ebc588da 100644 (file)
@@ -1793,6 +1793,9 @@ gfc_sym_type (gfc_symbol * sym)
                                                restricted);
              byref = 0;
            }
+
+         if (sym->attr.cray_pointee)
+           GFC_POINTER_TYPE_P (type) = 1;
         }
       else
        {
@@ -1808,7 +1811,7 @@ gfc_sym_type (gfc_symbol * sym)
     {
       if (sym->attr.allocatable || sym->attr.pointer)
        type = gfc_build_pointer_type (sym, type);
-      if (sym->attr.pointer)
+      if (sym->attr.pointer || sym->attr.cray_pointee)
        GFC_POINTER_TYPE_P (type) = 1;
     }
 
index 0bd021986aeaf40f60365a1dbb0b9c4168504a31..686fc381c280c1eb4d498ac2add843599cdfadec 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-06  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/43985
+       * gfortran.dg/gomp/crayptr5.f90: New test case.
+
 2010-05-05  Jason Merrill  <jason@redhat.com>
 
        PR debug/43370
diff --git a/gcc/testsuite/gfortran.dg/gomp/crayptr5.f90 b/gcc/testsuite/gfortran.dg/gomp/crayptr5.f90
new file mode 100644 (file)
index 0000000..5ade16c
--- /dev/null
@@ -0,0 +1,27 @@
+! { dg-do compile }
+! { dg-options "-fopenmp -fcray-pointer" }
+!
+! PR fortran/43985
+
+subroutine pete(A)
+  real(8) :: A
+  print *, 'pete got ',A
+  if (A /= 3.0) call abort()
+end subroutine pete
+
+       subroutine bob()
+         implicit none
+         real(8) peted
+         pointer (ipeted, peted(*))
+         integer(4) sz
+         ipeted = malloc(5*8)
+         peted(1:5) = [ 1.,2.,3.,4.,5.]
+         sz = 3
+!$omp parallel default(shared)
+         call pete(peted(sz))
+!$omp end parallel
+         return
+       end subroutine bob
+
+call bob()
+end