From: Jakub Jelinek Date: Mon, 11 Jul 2016 20:40:47 +0000 (+0200) Subject: re PR middle-end/71758 (ICE in verify_gimple_in_cfg, at tree-cfg.c:5212) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3d56e6a465a1fab02df9648c9dca41e98fabbae0;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ac3f065e1b1..7252ef87846 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2016-07-11 Jakub Jelinek + 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 b89978f7723..ecba096c5c1 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 067370114c9..a171ad874e9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2016-07-11 Jakub Jelinek + 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 00000000000..d3c86972ef5 --- /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 00000000000..47215ba5cd9 --- /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