This is the mail archive of the
mailing list for the GCC project.
Re: Merging debug-early work?
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: jason merrill <jason at redhat dot com>, GCC Mailing List <gcc at gcc dot gnu dot org>, David Edelsohn <dje dot gcc at gmail dot com>
- Date: Fri, 8 May 2015 10:51:12 +0200
- Subject: Re: Merging debug-early work?
- Authentication-results: sourceware.org; auth=none
- References: <55494527 dot 6040906 at redhat dot com> <CAFiYyc3znqta385iHCEu0jWXDvFNy0MaFgRZo3auJeh3D-A1nA at mail dot gmail dot com> <554B84D0 dot 5060309 at redhat dot com>
On Thu, May 7, 2015 at 5:29 PM, Aldy Hernandez <email@example.com> wrote:
> On 05/06/2015 04:22 AM, Richard Biener wrote:
>> On Wed, May 6, 2015 at 12:33 AM, Aldy Hernandez <firstname.lastname@example.org> wrote:
>>> I believe I have done as much as is reasonable for a merge, but I'd like
>>> get your opinion before I post a huge patch to the list.
>>> The branch bootstraps with one regression in GCC
>>> (gcc.dg/debug/dwarf2/stacked-qualified-types-3.c) and none for GDB.
>> On which triplets?
> So, two non x86 targets, and one non-x86 target that is also non-dwarf. Two
> primary targets and two secondary targets. For the record, the gdb
> testsuite was only run on x86_64-linux, everything else was just the usual
> GCC testing.
Did you see if --with-build-config=bootstrap-lto still works?
>>> The GCC regression is a missed optimization while merging the common
>>> denominator of a set of qualifiers for a type within a DIE. For example,
>>> two types share "const volatile" (say "const volatile int" and "const
>>> volatile char"), dwarf2out outputs things in the most efficient manner as
>>> share the maximum common type DIEs. This is not working in the branch as
>>> TYPE_MAIN_VARIANTs are not complete by the time early dwarf is run. If
>>> is possible, I'd like to work on this one regression post-merge. Not a
>>> deal if you disagree, but I'd prefer to postpone on this non crucial bit.
>>> A few caveats...
>>> Richi wants to play around with free-lang-data in the non LTO path. I
>>> haven't not done so, and it's left as an exercise to the reader :).
>> Yeah - I'd also like the early/late paths in dwarf2out.c to be refactored
>> to completely different functions (that is, not have a single function
>> creating and/or annotating DIEs early and late but two - with the late
>> one only doing the annotation work and only annotating with stuff
>> we expect). The branch already has accumulated quite some checks
>> like "if DIE was created early..." and with the LTO prototype work I saw
>> I'd only need to add (very?) much more of those.
> That would be very much appreciated. It is something I realized a bit too
Yeah. The nice thing is that we already have an entry for the most
sophisticated part - the function_decl debug-hook called from the
appropriate place in final.c for functions we have output.
Of course that simply maps to dwarf2out_decl right now, but it's a good
start to prune stuff here by "inlining" stuff here an pruning obviously
unnecessary (and harmful) stuff.
What we are missing is a corresponding hook (well, that could be
just late_gobal_decl ...) for global vars we output, called from the
approriate place in varasm.c (assemble_variable? called from
varpool assemble_decl via symtab output_variables).
At least hook-wise that would be the clean solution for the late dwarf stage.
While doing the LTO work I wondered why you have the late_global_decl
loop in toplev.c:compile_file at all (well, maybe due to the missing one
for global vars output). At least for function decls we should have covered
everything by that point.
Early debug seems to be enforced at finalize-compilation-unit time, but
only for function decls - I wonder why not as well for global vars
(and why the odd !decl_function_context check is there for functions).
That said, this and the code in rest_of_decl_compilation should best
be merged to a single place (preferably rest_of_decl_compilation).
>>> Thoughts on moving forward? Is the stacked qualifier regression a show
>>> stopper? Is the .debug_info size regression acceptable?
>> I think both are acceptable if they are fixed in a reasonable time frame
>> (before stage1 ends). So I suggest to go forward with merging and send
>> a nice patch-set.
> Great. Coming up...