aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index d14e01e..be02fb2 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4505,8 +4505,11 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree decl, unsigned int flags)
/* We're going to make use of the TYPE_SIZE_UNIT at least in the
alloca statement we generate for the variable, so make sure it
is available. This isn't automatically needed for the SHARED
- case, since we won't be allocating local storage then. */
- else
+ case, since we won't be allocating local storage then.
+ For local variables TYPE_SIZE_UNIT might not be gimplified yet,
+ in this case omp_notice_variable will be called later
+ on when it is gimplified. */
+ else if (! (flags & GOVD_LOCAL))
omp_notice_variable (ctx, TYPE_SIZE_UNIT (TREE_TYPE (decl)), true);
}
else if (lang_hooks.decls.omp_privatize_by_reference (decl))