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 <bernd.edlinger@hotmail.de>
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.
add_AT_addr (main_comp_unit_die, DW_AT_entry_pc, const0_rtx, true);
add_ranges (NULL);
+ have_multiple_function_sections = true;
}
}
--- /dev/null
+/* 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++)
+ ;
+}