aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2014-05-02 19:43:40 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2014-05-02 19:43:40 +0200
commit95782571f3bcd00cca47233cc07b927c24d400ef (patch)
treeaf453d4b9541da0c90d1c0689ff569fa7c986574 /gcc/omp-low.c
parent047f1cec7fe69c13ed55fcdd005ace93397f0a95 (diff)
downloadgcc-95782571f3bcd00cca47233cc07b927c24d400ef.zip
gcc-95782571f3bcd00cca47233cc07b927c24d400ef.tar.gz
gcc-95782571f3bcd00cca47233cc07b927c24d400ef.tar.bz2
gimplify.c (gimplify_adjust_omp_clauses_1): Handle GOVD_FIRSTPRIVATE | GOVD_LASTPRIVATE.
* gimplify.c (gimplify_adjust_omp_clauses_1): Handle GOVD_FIRSTPRIVATE | GOVD_LASTPRIVATE. (gimplify_adjust_omp_clauses): Simd region is never directly nested in combined parallel. Instead, for linear with copyin/copyout, if in combined for simd loop, make decl firstprivate/lastprivate on OMP_FOR. * omp-low.c (expand_omp_for_generic, expand_omp_for_static_nochunk, expand_omp_for_static_chunk): When setting endvar, also set fd->loop.v to the same value. libgomp/ * testsuite/libgomp.c/simd-10.c: New test. * testsuite/libgomp.c/simd-11.c: New test. * testsuite/libgomp.c/simd-12.c: New test. * testsuite/libgomp.c/simd-13.c: New test. From-SVN: r210009
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r--gcc/omp-low.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 28b2c6ae..453bd29 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -5584,6 +5584,12 @@ expand_omp_for_generic (struct omp_region *region,
{
stmt = gimple_build_assign (endvar, iend);
gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
+ if (useless_type_conversion_p (TREE_TYPE (fd->loop.v), TREE_TYPE (iend)))
+ stmt = gimple_build_assign (fd->loop.v, iend);
+ else
+ stmt = gimple_build_assign_with_ops (NOP_EXPR, fd->loop.v, iend,
+ NULL_TREE);
+ gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
}
if (fd->collapse > 1)
expand_omp_for_init_vars (fd, &gsi, counts, inner_stmt, startvar);
@@ -6000,6 +6006,12 @@ expand_omp_for_static_nochunk (struct omp_region *region,
{
stmt = gimple_build_assign (endvar, e);
gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
+ if (useless_type_conversion_p (TREE_TYPE (fd->loop.v), TREE_TYPE (e)))
+ stmt = gimple_build_assign (fd->loop.v, e);
+ else
+ stmt = gimple_build_assign_with_ops (NOP_EXPR, fd->loop.v, e,
+ NULL_TREE);
+ gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
}
if (fd->collapse > 1)
expand_omp_for_init_vars (fd, &gsi, counts, inner_stmt, startvar);
@@ -6385,6 +6397,12 @@ expand_omp_for_static_chunk (struct omp_region *region,
{
stmt = gimple_build_assign (endvar, e);
gsi_insert_after (&si, stmt, GSI_CONTINUE_LINKING);
+ if (useless_type_conversion_p (TREE_TYPE (fd->loop.v), TREE_TYPE (e)))
+ stmt = gimple_build_assign (fd->loop.v, e);
+ else
+ stmt = gimple_build_assign_with_ops (NOP_EXPR, fd->loop.v, e,
+ NULL_TREE);
+ gsi_insert_after (&si, stmt, GSI_CONTINUE_LINKING);
}
if (fd->collapse > 1)
expand_omp_for_init_vars (fd, &si, counts, inner_stmt, startvar);