Patchwork Fix PR46796

login
register
mail settings
Submitter Richard Guenther
Date Dec. 12, 2011, 10:55 a.m.
Message ID <alpine.LNX.2.00.1112121154060.4527@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/130702/
State New
Headers show

Comments

Richard Guenther - 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.

Richard.

2011-12-12  Richard Guenther  <rguenther@suse.de>

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

Patch

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));
 }