On Wed, 7 Dec 2011, Diego Novillo wrote: > On Wed, Dec 7, 2011 at 11:16, Richard Guenther <rguent...@suse.de> wrote: > > > I'm going to apply it tomorrow, when full testing hopefully finished > > Sure. But remember the zombie kitties!
I have applied the fix for PR48437, the fix for PR49945 required adjustment as otherwise we'd ICE gcc.dg/lto/20090706-1_0.c in the type checker. We also have to localize FIELD_DECLs of variable size types. Thus I'm re-testing the following and will commit that variant if it succeeds. I suppose at some point we need to look at the efficiency of the variably_modified_type_p call, as tree_is_indexable is called for each component type and variably_modified_type_p recurses itself (thus, overall this is quadratic, but with cheap constant factor as we are calling it with a NULL function arg). Richard. 2011-12-08 Richard Guenther <rguent...@suse.de> PR lto/49945 * lto-streamer-out.c (tree_is_indexable): Localize variably modified types and their FIELD_DECLs. Index: gcc/lto-streamer-out.c =================================================================== --- gcc/lto-streamer-out.c (revision 182101) +++ gcc/lto-streamer-out.c (working copy) @@ -139,6 +139,16 @@ tree_is_indexable (tree t) && DECL_CONTEXT (t) && TREE_CODE (DECL_CONTEXT (t)) == FUNCTION_DECL) return false; + /* Variably modified types need to be streamed alongside function + bodies because they can refer to local entities. Together with + them we have to localize their members as well. + ??? In theory that includes non-FIELD_DECLs as well. */ + else if (TYPE_P (t) + && variably_modified_type_p (t, NULL_TREE)) + return false; + else if (TREE_CODE (t) == FIELD_DECL + && variably_modified_type_p (DECL_CONTEXT (t), NULL_TREE)) + return false; else return (TYPE_P (t) || DECL_P (t) || TREE_CODE (t) == SSA_NAME); }