aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-01-28 23:33:33 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-01-28 23:33:33 +0100
commitbe3a87e7b5ff3d284a7663519826f2613dc46f69 (patch)
tree7f3f4b05ca6c6131553e48f493f88a3a420f4cad /gcc/gimplify.c
parent62d4a355b7346242fd2242a41662f3b18340f53d (diff)
downloadgcc-be3a87e7b5ff3d284a7663519826f2613dc46f69.zip
gcc-be3a87e7b5ff3d284a7663519826f2613dc46f69.tar.gz
gcc-be3a87e7b5ff3d284a7663519826f2613dc46f69.tar.bz2
re PR middle-end/89002 (ICE in scan_omp_1_op, at omp-low.c:3166)
PR middle-end/89002 * gimplify.c (gimplify_omp_for): When adding OMP_CLAUSE_*_GIMPLE_SEQ for lastprivate/linear IV, push gimplify context around gimplify_assign and, if it needed any temporaries, pop it into a gimple bind around the sequence. * testsuite/libgomp.c/pr89002.c: New test. From-SVN: r268345
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 5916678..7e37e50 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -11167,8 +11167,17 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
seq = &OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c);
else
seq = &OMP_CLAUSE_LINEAR_GIMPLE_SEQ (c);
+ push_gimplify_context ();
gimplify_assign (decl, t, seq);
- }
+ gimple *bind = NULL;
+ if (gimplify_ctxp->temps)
+ {
+ bind = gimple_build_bind (NULL_TREE, *seq, NULL_TREE);
+ *seq = NULL;
+ gimplify_seq_add_stmt (seq, bind);
+ }
+ pop_gimplify_context (bind);
+ }
}
}