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.
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)
{
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.
--- /dev/null
+/* 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])
+}
--- /dev/null
+! 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