From: Jakub Jelinek Date: Thu, 7 Jul 2016 21:53:53 +0000 (+0200) Subject: backport: re PR fortran/71705 (ICE in lower_omp_target, at omp-low.c:16136) X-Git-Tag: releases/gcc-4.9.4~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdfc9df0b21e990aa9fe24592a2e05b7bd199c5c;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: r238146 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 59409e16975f..0f54cc060bf9 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-05-26 Jerry DeLisle Backport from trunk. diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index ed66ea1dd71b..08e461e4e72c 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -2114,6 +2114,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 bf4e2596e76e..97fa950f440b 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