From: Bernd Edlinger Date: Tue, 11 May 2021 15:55:18 +0000 (+0200) Subject: Fix ICE in output_rnglists, at dwarf2out.c:12294 X-Git-Tag: basepoints/gcc-13~7573 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ecd1e6c894fbdbc10fdcfee419922b24e1115ee;p=thirdparty%2Fgcc.git Fix ICE in output_rnglists, at dwarf2out.c:12294 In this testcase the compile unit consists of a single text section with a single embedded DECL_IGNORED_P function. So we have a kind of multi-range text section here. To avoid an ICE in output_rnglists we need to make sure that have_multiple_function_sections is set to true. This is a regression from e69ac020372 ("Add line debug info for virtual thunks") 2021-05-12 Bernd Edlinger PR debug/100515 * dwarf2out.c (dwarf2out_finish): Set have_multiple_function_sections with multi-range text_section. * gcc.dg/debug/dwarf2/pr100515.c: New testcase. --- diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 8fc82989abcd..b99598eb9f8f 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -31956,6 +31956,7 @@ dwarf2out_finish (const char *filename) add_AT_addr (main_comp_unit_die, DW_AT_entry_pc, const0_rtx, true); add_ranges (NULL); + have_multiple_function_sections = true; } } diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr100515.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr100515.c new file mode 100644 index 000000000000..7c72fcd6693f --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr100515.c @@ -0,0 +1,19 @@ +/* PR debug/100515 */ +/* { dg-do compile } */ +/* { dg-options "-g -O2 -fopenmp" } */ + +void +foo (int x) +{ +#pragma omp taskloop + for (int i = 0; i < x; i++) + ; +} + +void +bar (int x) +{ +#pragma omp taskloop + for (int i = 0; i < x; i++) + ; +}