On Mon, 26 Aug 2024, Bernd Edlinger wrote: > This recent change triggered various bootsteap-errors, mostly on > x86 targets because line info advance address entries were output > in the wrong section table. > The switch to the wrong line table happened in dwarfout_set_ignored_loc. > It must use the same section as the earlier called > dwarf2out_switch_text_section. > > But also ft32-elf was affected, because the assembler choked on > something simple as ".2byte .LM2-.LM1", but fortunately it is > able to use native location views, the configure test was just > not executed because the ft32 "nop" instruction was missing.
OK for the configure part, I don't understand how using current_function_section is correct or how it even makes a differnce to function_section. It seems both would rely on the fact that fde->decl should be the same as cfun->decl and both eventually resort to how first_function_block_is_cold is set. Is this from final_scan_insn_1 where we seem to switch in_cold_section_p? The [current_]function_section API might be just confusing to me of course. I note that dwarf2out mixes both uses and current_function_section seems newer than function_section. Huh. Richard. > gcc/ChangeLog: > > PR debug/116470 > * configure.ac: Add the "nop" instruction for cpu type ft32. > * configure: Regenerate. > * dwarf2out.cc (dwarf2out_set_ignored_loc): Use the correct > line info section. > --- > gcc/configure | 2 +- > gcc/configure.ac | 2 +- > gcc/dwarf2out.cc | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/gcc/configure b/gcc/configure > index 557ea5fa3ac..3d301b6ecd3 100755 > --- a/gcc/configure > +++ b/gcc/configure > @@ -31398,7 +31398,7 @@ esac > case "$cpu_type" in > aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | loongarch > | m32c \ > | m68k | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | > sparc \ > - | visium | xstormy16 | xtensa) > + | visium | xstormy16 | xtensa | ft32) > insn="nop" > ;; > ia64 | s390) > diff --git a/gcc/configure.ac b/gcc/configure.ac > index eaa01d0d7e5..8a2d2b0438e 100644 > --- a/gcc/configure.ac > +++ b/gcc/configure.ac > @@ -5610,7 +5610,7 @@ esac > case "$cpu_type" in > aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | loongarch > | m32c \ > | m68k | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | > sparc \ > - | visium | xstormy16 | xtensa) > + | visium | xstormy16 | xtensa | ft32) > insn="nop" > ;; > ia64 | s390) > diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc > index a26a07e3424..1187d32352b 100644 > --- a/gcc/dwarf2out.cc > +++ b/gcc/dwarf2out.cc > @@ -28976,7 +28976,7 @@ dwarf2out_set_ignored_loc (unsigned int line, > unsigned int column, > dw_fde_ref fde = cfun->fde; > > fde->ignored_debug = false; > - set_cur_line_info_table (function_section (fde->decl)); > + set_cur_line_info_table (current_function_section ()); > > dwarf2out_source_line (line, column, filename, 0, true); > } > -- Richard Biener <rguent...@suse.de> SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)