Commit d902b330 by Jakub Jelinek Committed by Jakub Jelinek

omp-low.c (lower_omp_target): Set DECL_VALUE_EXPR of new_var even for the non-array case.

	* omp-low.c (lower_omp_target) <case USE_DEVICE_PTR>: Set
	DECL_VALUE_EXPR of new_var even for the non-array case.  Look
	through DECL_VALUE_EXPR for expansion.

	* c-c++-common/goacc/use_device-1.c: New test.

From-SVN: r232804
parent a4ea1723
2016-01-25 Jakub Jelinek <jakub@redhat.com>
* omp-low.c (lower_omp_target) <case USE_DEVICE_PTR>: Set
DECL_VALUE_EXPR of new_var even for the non-array case. Look
through DECL_VALUE_EXPR for expansion.
2016-01-25 Bernd Edlinger <bernd.edlinger@hotmail.de>
* config/mips/mips.c (mips_compute_frame_info): Skip re-computing
......
......@@ -15878,6 +15878,14 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
SET_DECL_VALUE_EXPR (new_var, x);
DECL_HAS_VALUE_EXPR_P (new_var) = 1;
}
else
{
tree new_var = lookup_decl (var, ctx);
x = create_tmp_var_raw (TREE_TYPE (new_var), get_name (new_var));
gimple_add_tmp_var (x);
SET_DECL_VALUE_EXPR (new_var, x);
DECL_HAS_VALUE_EXPR_P (new_var) = 1;
}
break;
}
......@@ -16493,6 +16501,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
x = build_fold_addr_expr (v);
}
}
new_var = DECL_VALUE_EXPR (new_var);
x = fold_convert (TREE_TYPE (new_var), x);
gimplify_expr (&x, &new_body, NULL, is_gimple_val, fb_rvalue);
gimple_seq_add_stmt (&new_body,
......
2016-01-25 Jakub Jelinek <jakub@redhat.com>
* c-c++-common/goacc/use_device-1.c: New test.
2016-01-25 Jeff Law <law@redhat.com>
PR tree-optimization/69196
......
/* { dg-do compile } */
void bar (float *, float *);
void
foo (float *x, float *y)
{
int n = 1 << 10;
#pragma acc data create(x[0:n]) copyout(y[0:n])
{
#pragma acc host_data use_device(x,y)
bar (x, y);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment