summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/gimplify.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/gimplify.c')
-rw-r--r--contrib/gcc/gimplify.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/contrib/gcc/gimplify.c b/contrib/gcc/gimplify.c
index 014a6e6..e6c0d1f 100644
--- a/contrib/gcc/gimplify.c
+++ b/contrib/gcc/gimplify.c
@@ -4053,6 +4053,19 @@ gimplify_asm_expr (tree *expr_p, tree *pre_p, tree *post_p)
parse_input_constraint (&constraint, 0, 0, noutputs, 0,
oconstraints, &allows_mem, &allows_reg);
+ /* If we can't make copies, we can only accept memory. */
+ if (TREE_ADDRESSABLE (TREE_TYPE (TREE_VALUE (link))))
+ {
+ if (allows_mem)
+ allows_reg = 0;
+ else
+ {
+ error ("impossible constraint in %<asm%>");
+ error ("non-memory input %d must stay in memory", i);
+ return GS_ERROR;
+ }
+ }
+
/* If the operand is a memory input, it should be an lvalue. */
if (!allows_reg && allows_mem)
{
@@ -4802,7 +4815,20 @@ gimplify_adjust_omp_clauses_1 (splay_tree_node n, void *data)
else if (flags & GOVD_SHARED)
{
if (is_global_var (decl))
- return 0;
+ {
+ struct gimplify_omp_ctx *ctx = gimplify_omp_ctxp->outer_context;
+ while (ctx != NULL)
+ {
+ splay_tree_node on
+ = splay_tree_lookup (ctx->variables, (splay_tree_key) decl);
+ if (on && (on->value & (GOVD_FIRSTPRIVATE | GOVD_LASTPRIVATE
+ | GOVD_PRIVATE | GOVD_REDUCTION)) != 0)
+ break;
+ ctx = ctx->outer_context;
+ }
+ if (ctx == NULL)
+ return 0;
+ }
code = OMP_CLAUSE_SHARED;
}
else if (flags & GOVD_PRIVATE)
OpenPOWER on IntegriCloud