From: Jakub Jelinek Date: Thu, 7 Jul 2016 12:49:04 +0000 (+0200) Subject: backport: re PR fortran/71705 (ICE in lower_omp_target, at omp-low.c:16136) X-Git-Tag: releases/gcc-5.5.0~988 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e8f52c0afe7dc14e4937e7f004989a2b729f9c8;p=thirdparty%2Fgcc.git backport: re PR fortran/71705 (ICE in lower_omp_target, at omp-low.c:16136) Backported from mainline 2016-06-30 Jakub Jelinek PR fortran/71705 * trans-openmp.c (gfc_trans_omp_clauses): Set TREE_ADDRESSABLE on decls in to/from clauses. * gfortran.dg/gomp/pr71705.f90: New test. From-SVN: r238102 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index c00c460282ea..9ffd5fa772a0 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,12 @@ +2016-07-07 Jakub Jelinek + + Backported from mainline + 2016-06-30 Jakub Jelinek + + PR fortran/71705 + * trans-openmp.c (gfc_trans_omp_clauses): Set TREE_ADDRESSABLE on + decls in to/from clauses. + 2016-06-27 Paul Thomas PR fortran/70673 diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index a413ac9c3753..c2fcffc3eab4 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -2180,6 +2180,8 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses, tree decl = gfc_get_symbol_decl (n->sym); if (gfc_omp_privatize_by_reference (decl)) decl = build_fold_indirect_ref (decl); + else if (DECL_P (decl)) + TREE_ADDRESSABLE (decl) = 1; if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))) { tree type = TREE_TYPE (decl); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b29949156533..9bfdd8d0d697 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,11 @@ 2016-07-07 Jakub Jelinek Backported from mainline + 2016-06-30 Jakub Jelinek + + PR fortran/71705 + * gfortran.dg/gomp/pr71705.f90: New test. + 2016-06-28 Jakub Jelinek PR middle-end/71626 diff --git a/gcc/testsuite/gfortran.dg/gomp/pr71705.f90 b/gcc/testsuite/gfortran.dg/gomp/pr71705.f90 new file mode 100644 index 000000000000..4813aacfdc32 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr71705.f90 @@ -0,0 +1,7 @@ +! PR fortran/71705 +! { dg-do compile } + + real :: x + x = 0.0 + !$omp target update to(x) +end