Commit a7fc274f by Eric Botcazou Committed by Eric Botcazou

tree.c (decl_value_expr_lookup): Revert latest change.

	* tree.c (decl_value_expr_lookup): Revert latest change.
	(decl_value_expr_insert): Likewise.
fortran/
	* trans-decl.c (gfc_get_fake_result_decl): Revert latest change.

From-SVN: r261696
parent 3b4f0408
2018-06-18 Eric Botcazou <ebotcazou@adacore.com>
* tree.c (decl_value_expr_lookup): Revert latest change.
(decl_value_expr_insert): Likewise.
2018-06-17 Eric Botcazou <ebotcazou@adacore.com> 2018-06-17 Eric Botcazou <ebotcazou@adacore.com>
* gimplify.c (nonlocal_vlas): Delete. * gimplify.c (nonlocal_vlas): Delete.
......
2018-06-18 Eric Botcazou <ebotcazou@adacore.com>
* trans-decl.c (gfc_get_fake_result_decl): Revert latest change.
2018-06-17 Eric Botcazou <ebotcazou@adacore.com> 2018-06-17 Eric Botcazou <ebotcazou@adacore.com>
* trans-decl.c (nonlocal_dummy_decl_pset): Delete. * trans-decl.c (nonlocal_dummy_decl_pset): Delete.
......
...@@ -2908,14 +2908,13 @@ gfc_get_fake_result_decl (gfc_symbol * sym, int parent_flag) ...@@ -2908,14 +2908,13 @@ gfc_get_fake_result_decl (gfc_symbol * sym, int parent_flag)
&& sym->ns->proc_name->attr.entry_master && sym->ns->proc_name->attr.entry_master
&& sym != sym->ns->proc_name) && sym != sym->ns->proc_name)
{ {
tree t = NULL, var, field; tree t = NULL, var;
if (this_fake_result_decl != NULL) if (this_fake_result_decl != NULL)
for (t = TREE_CHAIN (this_fake_result_decl); t; t = TREE_CHAIN (t)) for (t = TREE_CHAIN (this_fake_result_decl); t; t = TREE_CHAIN (t))
if (strcmp (IDENTIFIER_POINTER (TREE_PURPOSE (t)), sym->name) == 0) if (strcmp (IDENTIFIER_POINTER (TREE_PURPOSE (t)), sym->name) == 0)
break; break;
if (t) if (t)
return TREE_VALUE (t); return TREE_VALUE (t);
decl = gfc_get_fake_result_decl (sym->ns->proc_name, parent_flag); decl = gfc_get_fake_result_decl (sym->ns->proc_name, parent_flag);
if (parent_flag) if (parent_flag)
...@@ -2923,17 +2922,20 @@ gfc_get_fake_result_decl (gfc_symbol * sym, int parent_flag) ...@@ -2923,17 +2922,20 @@ gfc_get_fake_result_decl (gfc_symbol * sym, int parent_flag)
else else
this_fake_result_decl = current_fake_result_decl; this_fake_result_decl = current_fake_result_decl;
if (!sym->ns->proc_name->attr.mixed_entry_master) if (decl && sym->ns->proc_name->attr.mixed_entry_master)
return decl; {
tree field;
for (field = TYPE_FIELDS (TREE_TYPE (decl)); for (field = TYPE_FIELDS (TREE_TYPE (decl));
field; field = DECL_CHAIN (field)) field; field = DECL_CHAIN (field))
if (strcmp (IDENTIFIER_POINTER (DECL_NAME (field)), sym->name) == 0) if (strcmp (IDENTIFIER_POINTER (DECL_NAME (field)),
break; sym->name) == 0)
break;
gcc_assert (field != NULL_TREE); gcc_assert (field != NULL_TREE);
decl = fold_build3_loc (input_location, COMPONENT_REF, decl = fold_build3_loc (input_location, COMPONENT_REF,
TREE_TYPE (field), decl, field, NULL_TREE); TREE_TYPE (field), decl, field, NULL_TREE);
}
var = create_tmp_var_raw (TREE_TYPE (decl), sym->name); var = create_tmp_var_raw (TREE_TYPE (decl), sym->name);
if (parent_flag) if (parent_flag)
......
...@@ -6337,15 +6337,7 @@ decl_value_expr_lookup (tree from) ...@@ -6337,15 +6337,7 @@ decl_value_expr_lookup (tree from)
h = value_expr_for_decl->find_with_hash (&in, DECL_UID (from)); h = value_expr_for_decl->find_with_hash (&in, DECL_UID (from));
if (h) 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; return NULL_TREE;
} }
...@@ -6356,12 +6348,6 @@ decl_value_expr_insert (tree from, tree to) ...@@ -6356,12 +6348,6 @@ decl_value_expr_insert (tree from, tree to)
{ {
struct tree_decl_map *h; 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 = ggc_alloc<tree_decl_map> ();
h->base.from = from; h->base.from = from;
h->to = to; h->to = to;
......
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