re PR fortran/71705 (ICE in lower_omp_target, at omp-low.c:16136)
authorJakub Jelinek <jakub@redhat.com>
Thu, 30 Jun 2016 17:39:52 +0000 (19:39 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 30 Jun 2016 17:39:52 +0000 (19:39 +0200)
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: r237887

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

index 6ac8eaf..ea16f85 100644 (file)
@@ -1,3 +1,9 @@
+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-06-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR fortran/71686
index ab07fe4..b005d39 100644 (file)
@@ -2182,6 +2182,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 4081bd6..e9c6f19 100644 (file)
@@ -1,3 +1,8 @@
+2016-06-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/71705
+       * gfortran.dg/gomp/pr71705.f90: New test.
+
 2016-06-30  Kelvin Nilsen  <kelvin@gcc.gnu.org>
 
        * gcc.target/powerpc/dfp/dfp.exp: New dejagnu test script.
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