aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-06-17 11:36:58 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-06-17 11:36:58 +0000
commitd70ba0c10dec6968d178303709204fdde3d8892f (patch)
tree56c61211f3f65011db6e6bf06ce42a48fe05b176 /gcc/gimplify.c
parentf6a4a25f240e79dcdbca93f613c8c6face5c1211 (diff)
downloadgcc-d70ba0c10dec6968d178303709204fdde3d8892f.zip
gcc-d70ba0c10dec6968d178303709204fdde3d8892f.tar.gz
gcc-d70ba0c10dec6968d178303709204fdde3d8892f.tar.bz2
gimplify.c (nonlocal_vlas): Delete.
* gimplify.c (nonlocal_vlas): Delete. (nonlocal_vla_vars): Likewise. (gimplify_var_or_parm_decl): Do not add debug VAR_DECLs for non-local referenced VLAs. (gimplify_body): Do not create and destroy nonlocal_vlas. * tree-nested.c: Include diagnostic.h. (use_pointer_in_frame): Tweak. (lookup_field_for_decl): Add assertion and declare the transformation. (convert_nonlocal_reference_op) <PARM_DECL>: Rework and issue an internal error when the reference is in a wrong context. Do not create a debug decl by default. (note_nonlocal_block_vlas): Delete. (convert_nonlocal_reference_stmt) <GIMPLE_BIND>: Do not call it. (convert_local_reference_op) <PARM_DECL>: Skip the frame decl. Do not create a debug decl by default. (convert_gimple_call) <GIMPLE_CALL>: Issue an internal error when the call is in a wrong context. (fixup_vla_decls): New function. (finalize_nesting_tree_1): Adjust comment. Call fixup_vla_decls if no debug variables were created. * tree.c (decl_value_expr_lookup): Add checking assertion. (decl_value_expr_insert): Likewise. fortran/ * fortran/trans-decl.c (nonlocal_dummy_decl_pset): Delete. (nonlocal_dummy_decls): Likewise. (gfc_nonlocal_dummy_array_decl): Likewise. (gfc_get_symbol_decl): Do not call gfc_nonlocal_dummy_array_decl. (gfc_get_fake_result_decl): Do not generate a new DECL if simply reusing the result of a recursive call. (gfc_generate_function_code): Do not create, insert and destroy nonlocal_dummy_decls. From-SVN: r261687
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c65
1 files changed, 1 insertions, 64 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 32d7ad6..4bcdf44 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -2674,12 +2674,6 @@ gimplify_conversion (tree *expr_p)
return GS_OK;
}
-/* Nonlocal VLAs seen in the current function. */
-static hash_set<tree> *nonlocal_vlas;
-
-/* The VAR_DECLs created for nonlocal VLAs for debug info purposes. */
-static tree nonlocal_vla_vars;
-
/* Gimplify a VAR_DECL or PARM_DECL. Return GS_OK if we expanded a
DECL_VALUE_EXPR, and it's worth re-examining things. */
@@ -2710,38 +2704,7 @@ gimplify_var_or_parm_decl (tree *expr_p)
/* If the decl is an alias for another expression, substitute it now. */
if (DECL_HAS_VALUE_EXPR_P (decl))
{
- tree value_expr = DECL_VALUE_EXPR (decl);
-
- /* For referenced nonlocal VLAs add a decl for debugging purposes
- to the current function. */
- if (VAR_P (decl)
- && TREE_CODE (DECL_SIZE_UNIT (decl)) != INTEGER_CST
- && nonlocal_vlas != NULL
- && TREE_CODE (value_expr) == INDIRECT_REF
- && TREE_CODE (TREE_OPERAND (value_expr, 0)) == VAR_DECL
- && decl_function_context (decl) != current_function_decl)
- {
- struct gimplify_omp_ctx *ctx = gimplify_omp_ctxp;
- while (ctx
- && (ctx->region_type == ORT_WORKSHARE
- || ctx->region_type == ORT_SIMD
- || ctx->region_type == ORT_ACC))
- ctx = ctx->outer_context;
- if (!ctx && !nonlocal_vlas->add (decl))
- {
- tree copy = copy_node (decl);
-
- lang_hooks.dup_lang_specific_decl (copy);
- SET_DECL_RTL (copy, 0);
- TREE_USED (copy) = 1;
- DECL_CHAIN (copy) = nonlocal_vla_vars;
- nonlocal_vla_vars = copy;
- SET_DECL_VALUE_EXPR (copy, unshare_expr (value_expr));
- DECL_HAS_VALUE_EXPR_P (copy) = 1;
- }
- }
-
- *expr_p = unshare_expr (value_expr);
+ *expr_p = unshare_expr (DECL_VALUE_EXPR (decl));
return GS_OK;
}
@@ -12591,7 +12554,6 @@ gimplify_body (tree fndecl, bool do_parms)
gimple_seq parm_stmts, parm_cleanup = NULL, seq;
gimple *outer_stmt;
gbind *outer_bind;
- struct cgraph_node *cgn;
timevar_push (TV_TREE_GIMPLIFY);
@@ -12618,10 +12580,6 @@ gimplify_body (tree fndecl, bool do_parms)
unshare_body (fndecl);
unvisit_body (fndecl);
- cgn = cgraph_node::get (fndecl);
- if (cgn && cgn->origin)
- nonlocal_vlas = new hash_set<tree>;
-
/* Make sure input_location isn't set to something weird. */
input_location = DECL_SOURCE_LOCATION (fndecl);
@@ -12674,27 +12632,6 @@ gimplify_body (tree fndecl, bool do_parms)
}
}
- if (nonlocal_vlas)
- {
- if (nonlocal_vla_vars)
- {
- /* tree-nested.c may later on call declare_vars (..., true);
- which relies on BLOCK_VARS chain to be the tail of the
- gimple_bind_vars chain. Ensure we don't violate that
- assumption. */
- if (gimple_bind_block (outer_bind)
- == DECL_INITIAL (current_function_decl))
- declare_vars (nonlocal_vla_vars, outer_bind, true);
- else
- BLOCK_VARS (DECL_INITIAL (current_function_decl))
- = chainon (BLOCK_VARS (DECL_INITIAL (current_function_decl)),
- nonlocal_vla_vars);
- nonlocal_vla_vars = NULL_TREE;
- }
- delete nonlocal_vlas;
- nonlocal_vlas = NULL;
- }
-
if ((flag_openacc || flag_openmp || flag_openmp_simd)
&& gimplify_omp_ctxp)
{