diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-09-05 23:31:39 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-09-05 23:31:39 +0200 |
commit | bcc6842ba5563b075ed2946de20151928f572aca (patch) | |
tree | ead300eac786b1112032ec3f8f02984e27c3cb62 /gcc/omp-expand.c | |
parent | 3d178f0c0c800997a69d8e2824c9cc8148a89549 (diff) | |
download | gcc-bcc6842ba5563b075ed2946de20151928f572aca.zip gcc-bcc6842ba5563b075ed2946de20151928f572aca.tar.gz gcc-bcc6842ba5563b075ed2946de20151928f572aca.tar.bz2 |
re PR middle-end/81768 (error: control flow in the middle of basic block)
PR middle-end/81768
* omp-expand.c (expand_omp_simd): Force second operands of COND_EXPR
into gimple val before gimplification fo the COND_EXPR.
* gcc.dg/gomp/pr81768-1.c: New test.
From-SVN: r251741
Diffstat (limited to 'gcc/omp-expand.c')
-rw-r--r-- | gcc/omp-expand.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c index 7e27ae0..4bdcf19 100644 --- a/gcc/omp-expand.c +++ b/gcc/omp-expand.c @@ -4730,24 +4730,28 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd) tree itype2 = TREE_TYPE (fd->loops[i - 1].v); if (POINTER_TYPE_P (itype2)) itype2 = signed_type_for (itype2); + t = fold_convert (itype2, fd->loops[i - 1].step); + t = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true, + GSI_SAME_STMT); t = build3 (COND_EXPR, itype2, build2 (fd->loops[i].cond_code, boolean_type_node, fd->loops[i].v, fold_convert (itype, fd->loops[i].n2)), - build_int_cst (itype2, 0), - fold_convert (itype2, fd->loops[i - 1].step)); + build_int_cst (itype2, 0), t); if (POINTER_TYPE_P (TREE_TYPE (fd->loops[i - 1].v))) t = fold_build_pointer_plus (fd->loops[i - 1].v, t); else t = fold_build2 (PLUS_EXPR, itype2, fd->loops[i - 1].v, t); expand_omp_build_assign (&gsi, fd->loops[i - 1].v, t); + t = fold_convert (itype, fd->loops[i].n1); + t = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true, + GSI_SAME_STMT); t = build3 (COND_EXPR, itype, build2 (fd->loops[i].cond_code, boolean_type_node, fd->loops[i].v, fold_convert (itype, fd->loops[i].n2)), - fd->loops[i].v, - fold_convert (itype, fd->loops[i].n1)); + fd->loops[i].v, t); expand_omp_build_assign (&gsi, fd->loops[i].v, t); } } |