Commit f2e0c4e1 by Jakub Jelinek Committed by Jakub Jelinek

re PR fortran/77666 (ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:471)

	PR fortran/77666
	* trans-openmp.c (gfc_omp_private_outer_ref): Return true even for
	references to allocatable arrays.

	* gfortran.dg/gomp/pr77666.f90: New test.

From-SVN: r240522
parent 0fbac2d1
2016-09-27 Jakub Jelinek <jakub@redhat.com>
PR fortran/77666
* trans-openmp.c (gfc_omp_private_outer_ref): Return true even for
references to allocatable arrays.
2016-09-26 Steven G. Kargl <kargl@gcc.gnu.org> 2016-09-26 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77420 PR fortran/77420
......
...@@ -207,6 +207,9 @@ gfc_omp_private_outer_ref (tree decl) ...@@ -207,6 +207,9 @@ gfc_omp_private_outer_ref (tree decl)
{ {
tree type = TREE_TYPE (decl); tree type = TREE_TYPE (decl);
if (gfc_omp_privatize_by_reference (decl))
type = TREE_TYPE (type);
if (GFC_DESCRIPTOR_TYPE_P (type) if (GFC_DESCRIPTOR_TYPE_P (type)
&& GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ALLOCATABLE) && GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ALLOCATABLE)
return true; return true;
...@@ -214,9 +217,6 @@ gfc_omp_private_outer_ref (tree decl) ...@@ -214,9 +217,6 @@ gfc_omp_private_outer_ref (tree decl)
if (GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)) if (GFC_DECL_GET_SCALAR_ALLOCATABLE (decl))
return true; return true;
if (gfc_omp_privatize_by_reference (decl))
type = TREE_TYPE (type);
if (gfc_has_alloc_comps (type, decl)) if (gfc_has_alloc_comps (type, decl))
return true; return true;
......
2016-09-27 Jakub Jelinek <jakub@redhat.com>
PR fortran/77666
* gfortran.dg/gomp/pr77666.f90: New test.
2016-09-27 Kugan Vivekanandarajah <kuganv@linaro.org> 2016-09-27 Kugan Vivekanandarajah <kuganv@linaro.org>
PR ipa/77677 PR ipa/77677
......
! PR fortran/77666
! { dg-do compile }
subroutine foo(x)
interface
subroutine baz(x, y)
integer, allocatable :: x(:), y
end subroutine
end interface
integer, allocatable :: x(:), y
!$omp parallel private(x, y)
call baz (x, y)
!$omp end parallel
end
subroutine bar
interface
subroutine baz(x, y)
integer, allocatable :: x(:), y
end subroutine
end interface
integer, allocatable :: x(:), y
call baz (x, y)
!$omp parallel private(x, y)
call baz (x, y)
!$omp end parallel
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment