]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR fortran/71705 (ICE in lower_omp_target, at omp-low.c:16136)
authorJakub Jelinek <jakub@redhat.com>
Thu, 7 Jul 2016 21:53:53 +0000 (23:53 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 7 Jul 2016 21:53:53 +0000 (23:53 +0200)
Backported from mainline
2016-06-30  Jakub Jelinek  <jakub@redhat.com>

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

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

index 59409e16975f30ab8e171c8dceac1fde873ffdde..0f54cc060bf92f37fdb6a0e52dc9689acb957436 100644 (file)
@@ -1,3 +1,12 @@
+2016-07-07  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2016-06-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/71705
+       * trans-openmp.c (gfc_trans_omp_clauses): Set TREE_ADDRESSABLE on
+       decls in to/from clauses.
+
 2016-05-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        Backport from trunk.
index ed66ea1dd71bf897c179c740baf2b6ac3f0e54cf..08e461e4e72c3a8b6d7075916ec1da2c1a070aa2 100644 (file)
@@ -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);
index bf4e2596e76e385ef6fbbc38a51b96f9db24bc22..97fa950f440b4480deb607137b2b92209c90901b 100644 (file)
@@ -1,6 +1,11 @@
 2016-07-07  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2016-06-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/71705
+       * gfortran.dg/gomp/pr71705.f90: New test.
+
        2016-06-28  Jakub Jelinek  <jakub@redhat.com>
 
        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 (file)
index 0000000..4813aac
--- /dev/null
@@ -0,0 +1,7 @@
+! PR fortran/71705
+! { dg-do compile }
+
+  real :: x
+  x = 0.0
+  !$omp target update to(x)
+end