summaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-01 14:24:02 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-01 14:24:02 +0000
commit6ab9cde46cb0bb5aab3fea0a90b28ea7468cce30 (patch)
tree52005cd238123006b231cc7107a8b48143b7cd2f /gcc/gimplify.c
parent0cfe7a23ea25009b826058f5ef1395853a232e1b (diff)
downloadgcc-6ab9cde46cb0bb5aab3fea0a90b28ea7468cce30.tar.gz
PR middle-end/71371
* gimplify.c (gimplify_omp_for): Temporarily clear gimplify_omp_ctxp around creation of the temporary. * c-c++-common/gomp/pr71371.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236994 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 131fa2433ce..f12c6a11456 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -9009,7 +9009,12 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
|| (ort == ORT_SIMD
&& TREE_VEC_LENGTH (OMP_FOR_INIT (for_stmt)) > 1))
{
+ struct gimplify_omp_ctx *ctx = gimplify_omp_ctxp;
+ /* Make sure omp_add_variable is not called on it prematurely.
+ We call it ourselves a few lines later. */
+ gimplify_omp_ctxp = NULL;
var = create_tmp_var (TREE_TYPE (decl), get_name (decl));
+ gimplify_omp_ctxp = ctx;
TREE_OPERAND (t, 0) = var;
gimplify_seq_add_stmt (&for_body, gimple_build_assign (decl, var));