Fix PR46796

Message ID alpine.LNX.2.00.1112121154060.4527@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Dec. 12, 2011, 10:55 a.m.
On Fri, 9 Dec 2011, Richard Guenther wrote:

> This fixes PR46796 by making sure the types in the type variant chain
> can be looked up again using get_qualified_type.
> LTO bootstrap and regtest running on x86_64-unknown-linux-gnu.

Actually I didn't like that patch very much and here is a much
simpler and more localized variant - simply make sure the TYPE_NAMEs
are entered into the streamer cache at the time we pre-load the
type nodes.

LTO bootstrap and regtest running on x86_64-unknown-linux-gnu.


2011-12-12  Richard Guenther  <>

	PR lto/46796
	* tree-streamer.c (record_common_node): Also pre-load TYPE_NAMEs.


Index: gcc/tree-streamer.c
--- gcc/tree-streamer.c	(revision 182220)
+++ gcc/tree-streamer.c	(working copy)
@@ -277,6 +277,15 @@  record_common_node (struct streamer_tree
       for (f = TYPE_FIELDS (node); f; f = TREE_CHAIN (f))
 	record_common_node (cache, f);
+  /* To make qualified type variants pass the check_qualified_type test
+     we have to make sure to properly share TYPE_NAME.  Do so by also
+     pre-loading that to the cache.  See PR46796.
+     ???  To properly preserve name differences from different frontends
+     we should stop pre-loading those type nodes to the cache competely
+     instead.  */
+  if (TYPE_P (node))
+    record_common_node (cache, TYPE_NAME (node));