Hi, I will fix the free count issue - my internet access in China was bit sporadic and I hoped you will know why the count seem to disagree between PPC64 and Linux builds. In meantime PPC64 stopped to build for me. > > (early) dwarf2out is a good place, likewise verifying right after > free-lang-data. I agree that LTO type merging is also a good place. > > I hope we get early dwarf2out merged soon and can enable free-lang-data > also for non-LTO compilation. > > > LTO-Boostrapped/regtested x86_64-linux without Ada. I am doing full run on > > PPC64, but it fails on unrelated libgmp miscomplation I proably need to > > track down > > first. > > > > OK if testing passes? > > Please make sure to test _all_ languages (all,ada,obj-c++,go) and also > include multilibs in testing (thus -m64/-m32). > > You don't verify that TYPE_CANONICAL is consistent nor that TYPE_CANONICAL > doesn't form a tree (TYPE_CANONICAL (t) == TYPE_CANONICAL (TYPE_CANONICAL > (t))).
Yep, I have this one in queue, but of course it fires, thus it is not in the initial patch. > > +#ifdef ENABLE_CHECKING > > + verify_type (expr); > > +#endif > > As said I think that doing this after free-lang-data is better. Like > here: > > /* Traverse every type found freeing its language data. */ > FOR_EACH_VEC_ELT (fld.types, i, t) > free_lang_data_in_type (t); > > do another loop verifying types. OK, we however build new types in middle end (ipa-icf/ipa-split/ipa-sra), so perhaps we can check on both places? > > > stream_write_tree (ob, TYPE_SIZE (expr), ref_p); > > stream_write_tree (ob, TYPE_SIZE_UNIT (expr), ref_p); > > stream_write_tree (ob, TYPE_ATTRIBUTES (expr), ref_p); > > Index: dwarf2out.c > > =================================================================== > > --- dwarf2out.c (revision 222391) > > +++ dwarf2out.c (working copy) > > @@ -21264,6 +21264,11 @@ dwarf2out_decl (tree decl) > > { > > dw_die_ref context_die = comp_unit_die (); > > > > +#ifdef ENABLE_CHECKING > > + if (TREE_TYPE (decl)) > > + verify_type (TREE_TYPE (decl)); > > +#endif > > + > > Hmm, this has the chance to verify types multiple times, no? Wouldn't > gen_type_die_with_usage be a better place to verify the type we create > the DIE for? That looks better indeed. The checks are not paritcularly expensive though. Honza