From: jakub Date: Fri, 21 Oct 2016 15:09:49 +0000 (+0000) Subject: * gimplify.c (gimplify_bind_expr): Handle oacc_declare_returns X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5405a917d74279a1c2a4c9235e718598db2e1cf0;p=thirdparty%2Fgcc.git * gimplify.c (gimplify_bind_expr): Handle oacc_declare_returns even for -fstack-reuse=none, or for volatile vars etc. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241407 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9cce6aa0642f..3c819032613e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-10-21 Jakub Jelinek + + * gimplify.c (gimplify_bind_expr): Handle oacc_declare_returns + even for -fstack-reuse=none, or for volatile vars etc. + 2016-10-21 David Malcolm * print-rtl-function.c (flag_compact): Move extern decl to... diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 254dc735f0f2..d855c6700121 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -1192,21 +1192,24 @@ gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p) { if (VAR_P (t) && !is_global_var (t) - && DECL_CONTEXT (t) == current_function_decl - && !DECL_HARD_REGISTER (t) - && !TREE_THIS_VOLATILE (t) - && !DECL_HAS_VALUE_EXPR_P (t) - /* Only care for variables that have to be in memory. Others - will be rewritten into SSA names, hence moved to the top-level. */ - && !is_gimple_reg (t) - && flag_stack_reuse != SR_NONE) + && DECL_CONTEXT (t) == current_function_decl) { - tree clobber = build_constructor (TREE_TYPE (t), NULL); - gimple *clobber_stmt; - TREE_THIS_VOLATILE (clobber) = 1; - clobber_stmt = gimple_build_assign (t, clobber); - gimple_set_location (clobber_stmt, end_locus); - gimplify_seq_add_stmt (&cleanup, clobber_stmt); + if (!DECL_HARD_REGISTER (t) + && !TREE_THIS_VOLATILE (t) + && !DECL_HAS_VALUE_EXPR_P (t) + /* Only care for variables that have to be in memory. Others + will be rewritten into SSA names, hence moved to the + top-level. */ + && !is_gimple_reg (t) + && flag_stack_reuse != SR_NONE) + { + tree clobber = build_constructor (TREE_TYPE (t), NULL); + gimple *clobber_stmt; + TREE_THIS_VOLATILE (clobber) = 1; + clobber_stmt = gimple_build_assign (t, clobber); + gimple_set_location (clobber_stmt, end_locus); + gimplify_seq_add_stmt (&cleanup, clobber_stmt); + } if (flag_openacc && oacc_declare_returns != NULL) {