if (TREE_CODE (decl) == MEM_REF)
{
tree type = TREE_TYPE (decl);
+ bool saved_into_ssa = gimplify_ctxp->into_ssa;
+ gimplify_ctxp->into_ssa = false;
if (gimplify_expr (&TYPE_MAX_VALUE (TYPE_DOMAIN (type)), pre_p,
NULL, is_gimple_val, fb_rvalue, false)
== GS_ERROR)
{
+ gimplify_ctxp->into_ssa = saved_into_ssa;
remove = true;
break;
}
+ gimplify_ctxp->into_ssa = saved_into_ssa;
tree v = TYPE_MAX_VALUE (TYPE_DOMAIN (type));
if (DECL_P (v))
{
decl = TREE_OPERAND (decl, 0);
if (TREE_CODE (decl) == POINTER_PLUS_EXPR)
{
+ gimplify_ctxp->into_ssa = false;
if (gimplify_expr (&TREE_OPERAND (decl, 1), pre_p,
NULL, is_gimple_val, fb_rvalue, false)
== GS_ERROR)
{
+ gimplify_ctxp->into_ssa = saved_into_ssa;
remove = true;
break;
}
+ gimplify_ctxp->into_ssa = saved_into_ssa;
v = TREE_OPERAND (decl, 1);
if (DECL_P (v))
{
--- /dev/null
+/* PR middle-end/99007 */
+
+void
+bar (int n)
+{
+ int i;
+ long s[n];
+ for (i = 0; i < n; i++)
+ s[i] = 0;
+ #pragma omp teams distribute parallel for reduction(+:s) allocate(s)
+ for (i = 0; i < 8; i++)
+ s[3]++;
+}
--- /dev/null
+/* PR middle-end/99007 */
+
+int
+bar (int n)
+{
+ int s[n];
+ int i, j;
+ for (i = 0; i < n; i++)
+ s[i] = 0;
+ #pragma omp teams distribute parallel for reduction(+:s) private (j)
+ for (i = 0; i < 8; i++)
+ for (j = 0; j < n; j++)
+ s[j] += i;
+ return s[0] + s[n - 1];
+}
--- /dev/null
+/* PR middle-end/99007 */
+
+int
+bar (int n)
+{
+ int s[n];
+ int i, j;
+ for (i = 0; i < n; i++)
+ s[i] = 0;
+ #pragma omp parallel reduction(+:s) num_threads(2)
+ #pragma omp parallel for reduction(+:s) private (j)
+ for (i = 0; i < 8; i++)
+ for (j = 0; j < n; j++)
+ s[j] += i;
+ return s[0] + s[n - 1];
+}