+2016-06-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/71371
+ * gimplify.c (gimplify_omp_for): Temporarily clear gimplify_omp_ctxp
+ around creation of the temporary.
+
2016-06-01 Richard Biener <rguenther@suse.de>
PR tree-optimization/71366
|| (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));
+2016-06-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/71371
+ * c-c++-common/gomp/pr71371.c: New test.
+
2016-06-01 Richard Biener <rguenther@suse.de>
PR tree-optimization/71366
--- /dev/null
+/* PR middle-end/71371 */
+/* { dg-do compile } */
+
+void baz (int *);
+
+void
+foo (void)
+{
+ int i;
+ #pragma omp taskloop
+ for (i = 0; i < 100; i++)
+ baz (&i);
+}
+
+void
+bar (void)
+{
+ int i;
+ #pragma omp parallel
+ {
+ #pragma omp for
+ for (i = 0; i < 100; i++)
+ baz (&i);
+ }
+}