This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[Patch,Fortran] PR43985 ICE with cray pointee and OpenMP (4.5/4.6 regression)
- From: Tobias Burnus <burnus at net-b dot de>
- To: gfortran <fortran at gcc dot gnu dot org>, gcc patches <gcc-patches at gcc dot gnu dot org>, Asher Langton <langton2 at llnl dot gov>
- Date: Wed, 05 May 2010 10:00:49 +0200
- Subject: [Patch,Fortran] PR43985 ICE with cray pointee and OpenMP (4.5/4.6 regression)
The attached patch fixes the ICE.
Bootstrapped on x86-64-Linux and currently regtesting.
OK for the trunk and the 4.5 branch?
Tobias
PS: Asher, are you still working on PR 37039? (For completeness: Other
Cray-pointer related PRs are 38273 and 38273.)
2010-05-05 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 Tobias Burnus <burnus@net-b.de>
PR fortran/43985
* gfortran.dg/gomp/crayptr5.f90: New test case.
Index: gcc/fortran/trans-types.c
===================================================================
--- gcc/fortran/trans-types.c (Revision 159055)
+++ gcc/fortran/trans-types.c (Arbeitskopie)
@@ -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: gcc/testsuite/gfortran.dg/gomp/crayptr5.f90
===================================================================
--- gcc/testsuite/gfortran.dg/gomp/crayptr5.f90 (Revision 0)
+++ gcc/testsuite/gfortran.dg/gomp/crayptr5.f90 (Revision 0)
@@ -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