This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Refactor section/label init for early LTO debug
On Wed, 28 Sep 2016, Richard Biener wrote:
> On Tue, 27 Sep 2016, Rainer Orth wrote:
>
> > Hi Richard,
> >
> > >> this patch introduced many pch assembly comparison failures on Solaris
> > >> (both sparc and x86, 32 and 64-bit, /bin/as only), like
> > >>
> > >> FAIL: gcc.dg/pch/common-1.c -O3 -g assembly comparison
> > >> FAIL: gcc.dg/pch/common-1.c -O0 -g assembly comparison
> > >>
> > >> gcc.log shows this diff:
> > >>
> > >> < .long .Letext0
> > >> > .long
> > >>
> > >> While the .Letext0 label is still in the assembly output, it isn't
> > >> referenced inside .debug_line, as can be seen in the diff.
> > >
> > > Can you check if moving
> > >
> > > static void
> > > dwarf2out_assembly_start (void)
> > > {
> > > #ifndef DWARF2_LINENO_DEBUGGING_INFO
> > > ASM_GENERATE_INTERNAL_LABEL (text_section_label, TEXT_SECTION_LABEL, 0);
> > > ASM_GENERATE_INTERNAL_LABEL (text_end_label, TEXT_END_LABEL, 0);
> > > ASM_GENERATE_INTERNAL_LABEL (cold_text_section_label,
> > > COLD_TEXT_SECTION_LABEL, 0);
> > > ASM_GENERATE_INTERNAL_LABEL (cold_end_label, COLD_END_LABEL, 0);
> > >
> > > switch_to_section (text_section);
> > > ASM_OUTPUT_LABEL (asm_out_file, text_section_label);
> > > #endif
> > >
> > > back to dwarf2out_init helps? Ah! Does
> > >
> > > Index: gcc/dwarf2out.c
> > > ===================================================================
> > > --- gcc/dwarf2out.c (revision 240521)
> > > +++ gcc/dwarf2out.c (working copy)
> > > @@ -25657,14 +25687,6 @@ dwarf2out_init (const char *filename ATT
> > > vec_alloc (macinfo_table, 64);
> > > #endif
> > >
> > > - /* Make sure the line number table for .text always exists. */
> > > - text_section_line_info = new_line_info_table ();
> > > - text_section_line_info->end_label = text_end_label;
> > > -
> > > -#ifdef DWARF2_LINENO_DEBUGGING_INFO
> > > - cur_line_info_table = text_section_line_info;
> > > -#endif
> > > -
> > > /* If front-ends already registered a main translation unit but we were
> > > not
> > > ready to perform the association, do this now. */
> > > if (main_translation_unit != NULL_TREE)
> > > @@ -25688,6 +25710,14 @@ dwarf2out_assembly_start (void)
> > > ASM_OUTPUT_LABEL (asm_out_file, text_section_label);
> > > #endif
> > >
> > > + /* Make sure the line number table for .text always exists. */
> > > + text_section_line_info = new_line_info_table ();
> > > + text_section_line_info->end_label = text_end_label;
> > > +
> > > +#ifdef DWARF2_LINENO_DEBUGGING_INFO
> > > + cur_line_info_table = text_section_line_info;
> > > +#endif
> > > +
> > > if (HAVE_GAS_CFI_SECTIONS_DIRECTIVE
> > > && dwarf2out_do_cfi_asm ()
> > > && (!(flag_unwind_tables || flag_exceptions)
> > >
> > >
> > > fix it? Ok if it passes testing for you.
> >
> > testing on a single testcase worked fine. I'll just run a full
> > bootstrap to make sure everything is fine.
>
> Meanwhile I bootstrapped and tested it on x86_64-unknown-linux-gnu and
> applied it to trunk.
Ah, you already did.
Thanks,
Richard.