On Thu, Oct 12, 2017 at 10:51 PM, Eric Botcazou <ebotca...@adacore.com> wrote: > Hi, > > this PR reports a couple of problems with the support of the DW_AT_endianity > attribute associated with the scalar_storage_order source attribute: it does > not persist through typedefs and it can contaminate native order DIEs. > > The attached patch revamps it by associating native order DIEs and reverse > order DIEs into adjacent pairs for base types, as well as looking through > typedefs for base types with reverse order. This makes it possible to have a > single reverse order DIE for each base type and look it up efficiently. > > Tested on x86_64-suse-linux, OK for the mainline? What about the 7 branch?
Hmm. It makes tracking DIE builds difficult now that not all allocations go through new_die anymore. Can you instead split out a new_die_raw function with just the allocation and the die_tag initialization? Or make !parent_die && !t this mode, thus add if (parent_die != NULL) add_child_die (parent_die, die); else if (! t) return die; else { ? Otherwise the patch looks sensible. Thanks, Richard. > > 2017-10-12 Eric Botcazou <ebotca...@adacore.com> > > PR debug/82509 > * dwarf2out.c (base_type_die): Remove early return for corner cases. > Allocate the new DIE manually and do not call add_pubtype on it. > (is_base_type): Remove ERROR_MARK and return 0 for VOID_TYPE. > (modified_type_die): Adjust the lookup for reverse order DIEs. Skip > typedefs for base types with DW_AT_endianity. Make sure a DIE with > native order exists for base types, attach the DIE manually and call > add_pubtype on it. Do not equate a reverse order DIE to the type. > > > 2017-10-12 Eric Botcazou <ebotca...@adacore.com> > > * gcc.dg/debug/dwarf2/sso.c: Rename into... > * gcc.dg/debug/dwarf2/sso-1.c: ...this. > * gcc.dg/debug/dwarf2/sso-2.c: New test. > * gcc.dg/debug/dwarf2/sso-3.c: Likewise. > > -- > Eric Botcazou