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 6ac8eafb6670b8bb274da6516f535dc621c9a06d..ea16f8587a82cdf5bcbb52ef9afca3b796b99ed5 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 ab07fe45be9e1951a1631a1eb018328608e341bb..b005d392f477a98e3088cad9c18f2dfc1eea335e 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 4081bd6846b96d63d2e5a43570aa91c50617d17a..e9c6f19712a75d59a552692b88d76f65263f8223 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