From d902b330dc366702c0f6ab7f529c46cba253427c Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 25 Jan 2016 22:34:06 +0100 Subject: 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) : 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 --- gcc/omp-low.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/omp-low.c') diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 2977082..3615cbc 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -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, -- cgit v1.1