aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-07-11 22:40:47 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-07-11 22:40:47 +0200
commit3d56e6a465a1fab02df9648c9dca41e98fabbae0 (patch)
tree0ec2ecbac3290fa84d08353e78bd992080b1d8d2
parentc392943c5049a94782fe548003ddd0913b09b292 (diff)
downloadgcc-3d56e6a465a1fab02df9648c9dca41e98fabbae0.zip
gcc-3d56e6a465a1fab02df9648c9dca41e98fabbae0.tar.gz
gcc-3d56e6a465a1fab02df9648c9dca41e98fabbae0.tar.bz2
re PR middle-end/71758 (ICE in verify_gimple_in_cfg, at tree-cfg.c:5212)
PR middle-end/71758 * omp-low.c (expand_omp_target): Gimplify device. * c-c++-common/gomp/pr71758.c: New test. * gfortran.dg/gomp/pr71758.f90: New test. From-SVN: r238231
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/omp-low.c8
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr71758.c10
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr71758.f9010
5 files changed, 34 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ac3f065..7252ef8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
2016-07-11 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/71758
+ * omp-low.c (expand_omp_target): Gimplify device.
+
PR tree-optimization/71823
* tree-vect-stmts.c (vectorizable_operation): Use vect_get_vec_defs
to get vec_oprnds2 from op2.
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index b89978f..ecba096 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -13350,9 +13350,15 @@ expand_omp_target (struct omp_region *region)
make_edge (else_bb, new_bb, EDGE_FALLTHRU);
device = tmp_var;
+ gsi = gsi_last_bb (new_bb);
+ }
+ else
+ {
+ gsi = gsi_last_bb (new_bb);
+ device = force_gimple_operand_gsi (&gsi, device, true, NULL_TREE,
+ true, GSI_SAME_STMT);
}
- gsi = gsi_last_bb (new_bb);
t = gimple_omp_target_data_arg (entry_stmt);
if (t == NULL)
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0673701..a171ad8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2016-07-11 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/71758
+ * c-c++-common/gomp/pr71758.c: New test.
+ * gfortran.dg/gomp/pr71758.f90: New test.
+
PR tree-optimization/71823
* gcc.dg/vect/pr71823.c: New test.
diff --git a/gcc/testsuite/c-c++-common/gomp/pr71758.c b/gcc/testsuite/c-c++-common/gomp/pr71758.c
new file mode 100644
index 0000000..d3c8697
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr71758.c
@@ -0,0 +1,10 @@
+/* PR middle-end/71758 */
+
+void
+foo (int *p)
+{
+ long long i = 0;
+ #pragma omp target device (i)
+ ;
+ #pragma omp target update device (i) to (p[0])
+}
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr71758.f90 b/gcc/testsuite/gfortran.dg/gomp/pr71758.f90
new file mode 100644
index 0000000..47215ba
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr71758.f90
@@ -0,0 +1,10 @@
+! PR middle-end/71758
+
+subroutine pr71758 (p)
+ integer(8) :: i
+ integer :: p(20)
+ i = 0
+ !$omp target device(i)
+ !$omp end target
+ !$omp target update to(p(1:1)) device(i)
+end subroutine