Commit d74be317 by Richard Guenther Committed by Richard Biener

lto.c (uniquify_nodes): Fix bug in one of the previous changes.

2011-05-26  Richard Guenther  <rguenther@suse.de>

	lto/
	* lto.c (uniquify_nodes): Fix bug in one of the previous changes.

From-SVN: r174296
parent d3677132
2011-05-26 Richard Guenther <rguenther@suse.de>
* lto.c (uniquify_nodes): Fix bug in one of the previous changes.
2011-05-25 Nathan Froyd <froydnj@codesourcery.com> 2011-05-25 Nathan Froyd <froydnj@codesourcery.com>
* lto.c (lto_ft_typed): New function. * lto.c (lto_ft_typed): New function.
......
...@@ -610,33 +610,36 @@ uniquify_nodes (struct data_in *data_in, unsigned from) ...@@ -610,33 +610,36 @@ uniquify_nodes (struct data_in *data_in, unsigned from)
} }
} }
else if (RECORD_OR_UNION_TYPE_P (t)) else
{ {
tree f1, f2; if (RECORD_OR_UNION_TYPE_P (t))
if (TYPE_FIELDS (t) != TYPE_FIELDS (oldt)) {
for (f1 = TYPE_FIELDS (t), f2 = TYPE_FIELDS (oldt); tree f1, f2;
f1 && f2; f1 = TREE_CHAIN (f1), f2 = TREE_CHAIN (f2)) if (TYPE_FIELDS (t) != TYPE_FIELDS (oldt))
{ for (f1 = TYPE_FIELDS (t), f2 = TYPE_FIELDS (oldt);
unsigned ix; f1 && f2; f1 = TREE_CHAIN (f1), f2 = TREE_CHAIN (f2))
gcc_assert (f1 != f2 && DECL_NAME (f1) == DECL_NAME (f2)); {
if (!lto_streamer_cache_lookup (cache, f2, &ix)) unsigned ix;
gcc_unreachable (); gcc_assert (f1 != f2 && DECL_NAME (f1) == DECL_NAME (f2));
/* If we're going to replace an element which we'd if (!lto_streamer_cache_lookup (cache, f2, &ix))
still visit in the next iterations, we wouldn't gcc_unreachable ();
handle it, so do it here. We do have to handle it /* If we're going to replace an element which we'd
even though the field_decl itself will be removed, still visit in the next iterations, we wouldn't
as it could refer to e.g. integer_cst which we handle it, so do it here. We do have to handle it
wouldn't reach via any other way, hence they even though the field_decl itself will be removed,
(and their type) would stay uncollected. */ as it could refer to e.g. integer_cst which we
/* ??? We should rather make sure to replace all wouldn't reach via any other way, hence they
references to f2 with f1. That means handling (and their type) would stay uncollected. */
COMPONENT_REFs and CONSTRUCTOR elements in /* ??? We should rather make sure to replace all
lto_fixup_types and special-case the field-decl references to f2 with f1. That means handling
operand handling. */ COMPONENT_REFs and CONSTRUCTOR elements in
if (ix < i) lto_fixup_types and special-case the field-decl
lto_fixup_types (f2); operand handling. */
lto_streamer_cache_insert_at (cache, f1, ix); if (ix < i)
} lto_fixup_types (f2);
lto_streamer_cache_insert_at (cache, f1, ix);
}
}
/* If we found a tree that is equal to oldt replace it in the /* If we found a tree that is equal to oldt replace it in the
cache, so that further users (in the various LTO sections) cache, so that further users (in the various LTO sections)
......
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