> > OK if it survives more testing on firefox and lto bootstrap? > > It looks like a hack to do free_lang_data_in_type from free_lang_data_in_decl > walk - I remember you wanted to unify find_* and free_*? If not doing that
I did try it :) There is a catch - free lang data calls langhooks to produce mangled assembler names. For that the trees must be non-freed yet. So you can't do freeing as you discover what trees to follow. We can save one walk by computing assembler names during the discovery, but we need to know all trees we want to do langhooks on before we start putting NULL pointers around. > why would first doing the type walk and only then the decl walk not work > to avoid this ugliness? Hmm, currently we first walk decl and then types,so swapping them woudl work. But since I want to also simplify types in function types, it would break next. > > That we need to have variants of the incomplete types at all for the place > you substitute them (FIELD_DECLs) has what reason? See also comments below... > > We are getting more and more "interesting" in things we free. _Please_ work > on > enabling free-lang-data (portions) for all compilations (with > -fchecking?). It's disturbing to see > so much differences creep in in the supposedly "shared" part of regular and > LTO compilation. I wonder what is the plan to make late warnings to work reliably in this case? > > +/* Do same comparsion as check_qualified_type skipping lang part of type > > + and be more permissive about type names: we only care that names are > > + same (for diagnostics) and that ODR names are the same. */ > > + > > +static bool > > +types_equal_p (tree t, tree v) > > The function name is of course totally misleading. Please use sth like > fld_type_variants_equal_p. > > Note we already split check_qualified_type - can't you somehow re-use > check_base_type (only)? Hmm, you are right. I can re-unify those since this function basically cared about ... > > > +{ > > + if (t==v) > > + return true; > > + > > + if (TYPE_QUALS (t) != TYPE_QUALS (v)) > > + return false; > > + > > + if (TYPE_NAME (t) != TYPE_NAME (v) > > + && (!TYPE_NAME (t) || !TYPE_NAME (v) > > + || TREE_CODE (TYPE_NAME (t)) != TYPE_DECL > > + || TREE_CODE (TYPE_NAME (v)) != TYPE_DECL > > + || DECL_ASSEMBLER_NAME_RAW (TYPE_NAME (t)) > > + != DECL_ASSEMBLER_NAME_RAW (TYPE_NAME (v)) > > I wonder what this is about... ... unmerged TYPE_NAMEs which happens only on WPA state. It is leftover of my merging during streaming experiment. I will clean this up and send updated patch. I was bit in hurry leaving today and wanted to send at least initial patch for discussion. Honza