On Wed, 2014-09-24 at 14:11 -0400, Jason Merrill wrote: > > Anyway. I don't think this should hold up this specific bug fix. The > > issue with type units vs qualified type DIEs has been there in all > > previous versions of GCC (and only when using non-default flags). It > > really comes from DWARF not specifying anything about the ordering of > > type modifier tags. > > But GCC has been consistent about the ordering, and I would prefer not > to change that;
Sorry, I think I am missing what part was consistent that is being changed now. As my example shows even with older GCCs depending on whether a const type or volatile type was encountered first a const volatile type comes out either as a DIE chain const_type DIE -> volatile_type DIE -> type DIE, or the other way around, in different compile units. I believe this has always been done this way (at least since 4.6) and the order in different compile units was not "consistent". It was just optimal, preferring the shortest path to an already existing qualified type in that compile unit if there was one. The only thing that has changed is that we handle more qualifier modifiers now (well actually only one for now, restrict). What the patch fixes is a bug (PR63300, that I introduced, sorry) where we would completely drop all qualifiers. It doesn't change making the ordering of the type qualifier tags more or less consistent between compile units I believe. > I would expect it to hurt dwz compression as well as type units. dwz is somewhat similar to type units in this respect. But unlike type units it doesn't prescribe using an ordered flattened DIE chain. So (in theory) it can just swap around qualifier type tags if that is beneficial for merging more type DIE trees. But maybe I am missing something that makes things worse/different from how they were before? Cheers, Mark