On Wed, 2014-09-24 at 10:47 -0400, Jason Merrill wrote: > On 09/23/2014 06:53 PM, Mark Wielaard wrote: > > And for the default case (gcc doesn't > > create type sections by default) the optimization is useful. > > I'm skeptical. These DIEs are very small, and I wouldn't expect a hole > in the qualifier space like this to come up that often.
But if you don't take the optimization (re-use an existing sub-qualified type when you have a type with multiple qualifiers) then you might have to pessimize (o, there is already such a sub-qualified type, but I have to first create a different sub-qualified type because the order will come out "wrong"). So you might end up with extra type DIEs then. 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. If we do think it matters, then lets discuss with the DWARF committee first what a good fix would be to make type units handle different orderings. And then open a new bug for this if we want it fixed. Cheers, Mark