Hi Andreas, On Wed, 2014-09-24 at 14:40 +0200, Andreas Arnez wrote: > I changed the patch a bit further, to reduce unnecessary > iterations and recursions, and tested it again.
Thanks for adding the tests and the testing. I think in general it is a nicer and cleaner fix than I did. I do have a question about the removal of the recursion of modified_type_die while stripping/adding qualifiers though: > + /* Determine a lesser qualified type that most closely matches > + this one. Then generate DW_TAG_* entries for the remaining > + qualifiers. */ > + sub_quals = get_nearest_type_subqualifiers (type, cv_quals, > + cv_qual_mask); > + mod_type_die = modified_type_die (type, sub_quals, context_die); > + > + for (i = 0; i < sizeof (qual_info) / sizeof (qual_info[0]); i++) > + if (qual_info[i].q & cv_quals & ~sub_quals) > + { > + dw_die_ref d = new_die (qual_info[i].t, mod_scope, type); > + if (mod_type_die) > + add_AT_die_ref (d, DW_AT_type, mod_type_die); > + mod_type_die = d; > + } Are you sure this is completely equivalent to the previous code that recursed into modified_type_die again for each qualifier added? At the top of modified_type_die we check whether there is already a qualified type and if there is then we try to get the DIE for that one with lookup_type_die. If there is no such DIE yet, then at the end of modified_type_die we associate that type with the DIE with a call to equate_type_number_to_die. In your patch we skip that association in case we need to add more than one qualifier. Is it guaranteed that for these "in between" qualified type DIES there is no associated real type that get_qualified_type would have been able to find? O. Yes, of course that is guaranteed. If there was such a type then get_nearest_type_subqualifiers would have returned it. Doh. OK. Now do I delete this whole email? Or will I just say: Looks good to me after thinking a bit about it. :) Thanks, Mark