aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.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/tree.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/tree.c')
-rw-r--r--gcc/tree.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 2d3b26e..8082932 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -6337,7 +6337,15 @@ decl_value_expr_lookup (tree from)
h = value_expr_for_decl->find_with_hash (&in, DECL_UID (from));
if (h)
- return h->to;
+ {
+ /* Chains of value expressions may run afoul of garbage collection. */
+ gcc_checking_assert (!(h->to
+ && (TREE_CODE (h->to) == PARM_DECL
+ || TREE_CODE (h->to) == VAR_DECL)
+ && DECL_HAS_VALUE_EXPR_P (h->to)));
+ return h->to;
+ }
+
return NULL_TREE;
}
@@ -6348,6 +6356,12 @@ decl_value_expr_insert (tree from, tree to)
{
struct tree_decl_map *h;
+ /* Chains of value expressions may run afoul of garbage collection. */
+ gcc_checking_assert (!(to
+ && (TREE_CODE (to) == PARM_DECL
+ || TREE_CODE (to) == VAR_DECL)
+ && DECL_HAS_VALUE_EXPR_P (to)));
+
h = ggc_alloc<tree_decl_map> ();
h->base.from = from;
h->to = to;