Re: Un-break dwarf2out for DWARF2_LINENO_DEBUGGING_INFO configurations (was: [PATCH] Refactor section/label init for early LTO debug)

2016-10-12 Thread Thomas Schwinge
Hi!

On Wed, 28 Sep 2016 11:28:16 +0200 (CEST), Richard Biener  
wrote:
> On Wed, 28 Sep 2016, Thomas Schwinge wrote:
> > ([...] got committed in r240545.)  For DWARF2_LINENO_DEBUGGING_INFO
> > configurations (that is, nvptx; Bernd CCed, who originally authored the
> > DWARF2_LINENO_DEBUGGING_INFO support), this breaks things because of
> > uninitialized text_section_line_info/cur_line_info_table.  OK to fix as
> > follows?
> 
> Ok.

Without changes committed to trunk in r241045:

commit 84cb1b769377413a1b7cef73fc4f6022e046b0a9
Author: tschwinge 
Date:   Wed Oct 12 13:09:26 2016 +

Un-break dwarf2out for DWARF2_LINENO_DEBUGGING_INFO configurations

gcc/
* dwarf2out.c (dwarf2_lineno_debug_hooks): Use
dwarf2out_assembly_start.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241045 
138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog   | 3 +++
 gcc/dwarf2out.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git gcc/ChangeLog gcc/ChangeLog
index d6880d9..c66b7a7 100644
--- gcc/ChangeLog
+++ gcc/ChangeLog
@@ -1,5 +1,8 @@
 2016-10-12  Thomas Schwinge  
 
+   * dwarf2out.c (dwarf2_lineno_debug_hooks): Use
+   dwarf2out_assembly_start.
+
* Makefile.in (SELFTEST_FLAGS): Add -nostdinc.
 
* Makefile.in (SELFTEST_FLAGS): New variable.
diff --git gcc/dwarf2out.c gcc/dwarf2out.c
index b5787ef..98deeef 100644
--- gcc/dwarf2out.c
+++ gcc/dwarf2out.c
@@ -2540,7 +2540,7 @@ const struct gcc_debug_hooks dwarf2_lineno_debug_hooks =
   dwarf2out_init,
   debug_nothing_charstar,
   debug_nothing_charstar,
-  debug_nothing_void,
+  dwarf2out_assembly_start,
   debug_nothing_int_charstar,
   debug_nothing_int_charstar,
   debug_nothing_int_charstar,


Grüße
 Thomas


Re: Un-break dwarf2out for DWARF2_LINENO_DEBUGGING_INFO configurations (was: [PATCH] Refactor section/label init for early LTO debug)

2016-09-28 Thread Richard Biener
On Wed, 28 Sep 2016, Thomas Schwinge wrote:

> Hi!
> 
> On Tue, 27 Sep 2016 12:34:46 +0200 (CEST), Richard Biener  
> wrote:
> > --- 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)
> 
> (This got committed in r240545.)  For DWARF2_LINENO_DEBUGGING_INFO
> configurations (that is, nvptx; Bernd CCed, who originally authored the
> DWARF2_LINENO_DEBUGGING_INFO support), this breaks things because of
> uninitialized text_section_line_info/cur_line_info_table.  OK to fix as
> follows?

Ok.

Richard.

> commit e745307ac5a90e999133df21139526230e81
> Author: Thomas Schwinge 
> Date:   Wed Sep 28 10:55:23 2016 +0200
> 
> Un-break dwarf2out for DWARF2_LINENO_DEBUGGING_INFO configurations
> 
>   gcc/
>   * dwarf2out.c (dwarf2_lineno_debug_hooks): Use
>   dwarf2out_assembly_start.
> ---
>  gcc/dwarf2out.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git gcc/dwarf2out.c gcc/dwarf2out.c
> index 51cab42..8c18c4c 100644
> --- gcc/dwarf2out.c
> +++ gcc/dwarf2out.c
> @@ -2539,7 +2539,7 @@ const struct gcc_debug_hooks dwarf2_lineno_debug_hooks =
>dwarf2out_init,
>debug_nothing_charstar,
>debug_nothing_charstar,
> -  debug_nothing_void,
> +  dwarf2out_assembly_start,
>debug_nothing_int_charstar,
>debug_nothing_int_charstar,
>debug_nothing_int_charstar,
>