From b08544362ee92895e04e7363d2c9f5cbd09a820e Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 20 Jan 2021 17:54:51 +0100 Subject: [PATCH] 11.0.0-0.16 --- gcc.spec | 14 ++- gcc11-libgomp-task.patch | 69 +++++++++++++++ gcc11-pr98751.patch | 185 +++++++++++++++++++++++++++++++++++++++ gcc11-pr98765.patch | 83 ++++++++++++++++++ 4 files changed, 350 insertions(+), 1 deletion(-) create mode 100644 gcc11-libgomp-task.patch create mode 100644 gcc11-pr98751.patch create mode 100644 gcc11-pr98765.patch diff --git a/gcc.spec b/gcc.spec index 5a69606..96ba798 100644 --- a/gcc.spec +++ b/gcc.spec @@ -119,7 +119,7 @@ Summary: Various compilers (C, C++, Objective-C, ...) Name: gcc Version: %{gcc_version} -Release: %{gcc_release}.15%{?dist} +Release: %{gcc_release}.16%{?dist} # libgcc, libgfortran, libgomp, libstdc++ and crtstuff have # GCC Runtime Exception. License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD @@ -277,6 +277,9 @@ Patch14: gcc11-pr98687.patch Patch15: gcc11-pr98721.patch Patch16: gcc11-pr98742.patch Patch17: gcc11-pr98638.patch +Patch18: gcc11-pr98765.patch +Patch19: gcc11-libgomp-task.patch +Patch20: gcc11-pr98751.patch # On ARM EABI systems, we do want -gnueabi to be part of the # target triple. @@ -793,6 +796,9 @@ to NVidia PTX capable devices if available. %patch15 -p0 -b .pr98721~ %patch16 -p0 -b .pr98742~ %patch17 -p0 -b .pr98638~ +%patch18 -p0 -b .pr98765~ +%patch19 -p0 -b .libgomp-task~ +%patch20 -p0 -b .pr98751~ rm -f libgomp/testsuite/*/*task-detach* @@ -3079,6 +3085,12 @@ end %endif %changelog +* Wed Jan 20 2021 Jakub Jelinek 11.0.0-0.16 +- fix DWARF5 -g -flto -ffat-lto-objects, so that LTO sections can be stripped off + later (PR debug/98765) +- fix GOMP_task caller stack corruption on s390x +- libgccjit DWARF5 fixes (PR debug/98751) + * Tue Jan 19 2021 Jakub Jelinek 11.0.0-0.15 - update from trunk - PRs debug/98708, debug/98716, ipa/98222, libstdc++/98725, target/97847, diff --git a/gcc11-libgomp-task.patch b/gcc11-libgomp-task.patch new file mode 100644 index 0000000..b0ba04e --- /dev/null +++ b/gcc11-libgomp-task.patch @@ -0,0 +1,69 @@ +2021-01-20 Jakub Jelinek + + * task.c (GOMP_task): Rename priority argument to priority_arg, + add priority automatic variable and modify that variable. Instead of + clearing detach argument when GOMP_TASK_FLAG_DETACH bit is not set, + check flags for that bit. + +--- libgomp/task.c.jj 2021-01-18 07:18:42.362339622 +0100 ++++ libgomp/task.c 2021-01-20 17:23:36.973758174 +0100 +@@ -354,10 +354,11 @@ task_fulfilled_p (struct gomp_task *task + void + GOMP_task (void (*fn) (void *), void *data, void (*cpyfn) (void *, void *), + long arg_size, long arg_align, bool if_clause, unsigned flags, +- void **depend, int priority, void *detach) ++ void **depend, int priority_arg, void *detach) + { + struct gomp_thread *thr = gomp_thread (); + struct gomp_team *team = thr->ts.team; ++ int priority = 0; + + #ifdef HAVE_BROKEN_POSIX_SEMAPHORES + /* If pthread_mutex_* is used for omp_*lock*, then each task must be +@@ -385,13 +386,12 @@ GOMP_task (void (*fn) (void *), void *da + } + } + +- if ((flags & GOMP_TASK_FLAG_PRIORITY) == 0) +- priority = 0; +- else if (priority > gomp_max_task_priority_var) +- priority = gomp_max_task_priority_var; +- +- if ((flags & GOMP_TASK_FLAG_DETACH) == 0) +- detach = NULL; ++ if (__builtin_expect ((flags & GOMP_TASK_FLAG_PRIORITY) != 0, 0)) ++ { ++ priority = priority_arg; ++ if (priority > gomp_max_task_priority_var) ++ priority = gomp_max_task_priority_var; ++ } + + if (!if_clause || team == NULL + || (thr->task && thr->task->final_task) +@@ -415,7 +415,7 @@ GOMP_task (void (*fn) (void *), void *da + || (flags & GOMP_TASK_FLAG_FINAL); + task.priority = priority; + +- if (detach) ++ if ((flags & GOMP_TASK_FLAG_DETACH) != 0) + { + task.detach = true; + gomp_sem_init (&task.completion_sem, 0); +@@ -443,7 +443,7 @@ GOMP_task (void (*fn) (void *), void *da + else + fn (data); + +- if (detach && !task_fulfilled_p (&task)) ++ if (task.detach && !task_fulfilled_p (&task)) + gomp_sem_wait (&task.completion_sem); + + /* Access to "children" is normally done inside a task_lock +@@ -484,7 +484,7 @@ GOMP_task (void (*fn) (void *), void *da + task->kind = GOMP_TASK_UNDEFERRED; + task->in_tied_task = parent->in_tied_task; + task->taskgroup = taskgroup; +- if (detach) ++ if ((flags & GOMP_TASK_FLAG_DETACH) != 0) + { + task->detach = true; + gomp_sem_init (&task->completion_sem, 0); diff --git a/gcc11-pr98751.patch b/gcc11-pr98751.patch new file mode 100644 index 0000000..c0caaf8 --- /dev/null +++ b/gcc11-pr98751.patch @@ -0,0 +1,185 @@ +2021-01-19 David Malcolm + + PR debug/98751 + * dwarf2out.c (output_line_info): Rename static variable + "generation", moving it out of the function to... + (output_line_info_generation): New. + (init_sections_and_labels): Likewise, renaming the variable to... + (init_sections_and_labels_generation): New. + (dwarf2out_c_finalize): Reset the new variables. + +--- gcc/dwarf2out.c ++++ gcc/dwarf2out.c +@@ -12709,22 +12709,27 @@ output_one_line_info_table (dw_line_info_table *table) + dw2_asm_output_data (1, DW_LNE_end_sequence, NULL); + } + ++static unsigned int output_line_info_generation; ++ + /* Output the source line number correspondence information. This + information goes into the .debug_line section. */ + + static void + output_line_info (bool prologue_only) + { +- static unsigned int generation; + char l1[MAX_ARTIFICIAL_LABEL_BYTES], l2[MAX_ARTIFICIAL_LABEL_BYTES]; + char p1[MAX_ARTIFICIAL_LABEL_BYTES], p2[MAX_ARTIFICIAL_LABEL_BYTES]; + bool saw_one = false; + int opc; + +- ASM_GENERATE_INTERNAL_LABEL (l1, LINE_NUMBER_BEGIN_LABEL, generation); +- ASM_GENERATE_INTERNAL_LABEL (l2, LINE_NUMBER_END_LABEL, generation); +- ASM_GENERATE_INTERNAL_LABEL (p1, LN_PROLOG_AS_LABEL, generation); +- ASM_GENERATE_INTERNAL_LABEL (p2, LN_PROLOG_END_LABEL, generation++); ++ ASM_GENERATE_INTERNAL_LABEL (l1, LINE_NUMBER_BEGIN_LABEL, ++ output_line_info_generation); ++ ASM_GENERATE_INTERNAL_LABEL (l2, LINE_NUMBER_END_LABEL, ++ output_line_info_generation); ++ ASM_GENERATE_INTERNAL_LABEL (p1, LN_PROLOG_AS_LABEL, ++ output_line_info_generation); ++ ASM_GENERATE_INTERNAL_LABEL (p2, LN_PROLOG_END_LABEL, ++ output_line_info_generation++); + + if (!XCOFF_DEBUGGING_INFO) + { +@@ -28589,6 +28594,10 @@ output_macinfo (const char *debug_line_label, bool early_lto_debug) + macinfo_label_base += macinfo_label_base_adj; + } + ++/* As init_sections_and_labels may get called multiple times, have a ++ generation count for labels. */ ++static unsigned init_sections_and_labels_generation; ++ + /* Initialize the various sections and labels for dwarf output and prefix + them with PREFIX if non-NULL. Returns the generation (zero based + number of times function was called). */ +@@ -28596,10 +28605,6 @@ output_macinfo (const char *debug_line_label, bool early_lto_debug) + static unsigned + init_sections_and_labels (bool early_lto_debug) + { +- /* As we may get called multiple times have a generation count for +- labels. */ +- static unsigned generation = 0; +- + if (early_lto_debug) + { + if (!dwarf_split_debug_info) +@@ -28634,7 +28639,7 @@ init_sections_and_labels (bool early_lto_debug) + SECTION_DEBUG | SECTION_EXCLUDE, NULL); + ASM_GENERATE_INTERNAL_LABEL (debug_skeleton_abbrev_section_label, + DEBUG_SKELETON_ABBREV_SECTION_LABEL, +- generation); ++ init_sections_and_labels_generation); + + /* Somewhat confusing detail: The skeleton_[abbrev|info] sections + stay in the main .o, but the skeleton_line goes into the split +@@ -28644,14 +28649,14 @@ init_sections_and_labels (bool early_lto_debug) + SECTION_DEBUG | SECTION_EXCLUDE, NULL); + ASM_GENERATE_INTERNAL_LABEL (debug_skeleton_line_section_label, + DEBUG_SKELETON_LINE_SECTION_LABEL, +- generation); ++ init_sections_and_labels_generation); + debug_str_offsets_section + = get_section (DEBUG_LTO_DWO_STR_OFFSETS_SECTION, + SECTION_DEBUG | SECTION_EXCLUDE, + NULL); + ASM_GENERATE_INTERNAL_LABEL (debug_skeleton_info_section_label, + DEBUG_SKELETON_INFO_SECTION_LABEL, +- generation); ++ init_sections_and_labels_generation); + debug_str_dwo_section = get_section (DEBUG_LTO_STR_DWO_SECTION, + DEBUG_STR_DWO_SECTION_FLAGS, + NULL); +@@ -28667,7 +28672,8 @@ init_sections_and_labels (bool early_lto_debug) + debug_line_section = get_section (DEBUG_LTO_LINE_SECTION, + SECTION_DEBUG | SECTION_EXCLUDE, NULL); + ASM_GENERATE_INTERNAL_LABEL (debug_line_section_label, +- DEBUG_LINE_SECTION_LABEL, generation); ++ DEBUG_LINE_SECTION_LABEL, ++ init_sections_and_labels_generation); + + debug_str_section = get_section (DEBUG_LTO_STR_SECTION, + DEBUG_STR_SECTION_FLAGS +@@ -28711,7 +28717,7 @@ init_sections_and_labels (bool early_lto_debug) + SECTION_DEBUG, NULL); + ASM_GENERATE_INTERNAL_LABEL (debug_skeleton_abbrev_section_label, + DEBUG_SKELETON_ABBREV_SECTION_LABEL, +- generation); ++ init_sections_and_labels_generation); + + /* Somewhat confusing detail: The skeleton_[abbrev|info] sections + stay in the main .o, but the skeleton_line goes into the +@@ -28721,13 +28727,13 @@ init_sections_and_labels (bool early_lto_debug) + SECTION_DEBUG | SECTION_EXCLUDE, NULL); + ASM_GENERATE_INTERNAL_LABEL (debug_skeleton_line_section_label, + DEBUG_SKELETON_LINE_SECTION_LABEL, +- generation); ++ init_sections_and_labels_generation); + debug_str_offsets_section + = get_section (DEBUG_DWO_STR_OFFSETS_SECTION, + SECTION_DEBUG | SECTION_EXCLUDE, NULL); + ASM_GENERATE_INTERNAL_LABEL (debug_skeleton_info_section_label, + DEBUG_SKELETON_INFO_SECTION_LABEL, +- generation); ++ init_sections_and_labels_generation); + debug_loc_section = get_section (dwarf_version >= 5 + ? DEBUG_DWO_LOCLISTS_SECTION + : DEBUG_DWO_LOC_SECTION, +@@ -28767,31 +28773,37 @@ init_sections_and_labels (bool early_lto_debug) + } + + ASM_GENERATE_INTERNAL_LABEL (abbrev_section_label, +- DEBUG_ABBREV_SECTION_LABEL, generation); ++ DEBUG_ABBREV_SECTION_LABEL, ++ init_sections_and_labels_generation); + ASM_GENERATE_INTERNAL_LABEL (debug_info_section_label, +- DEBUG_INFO_SECTION_LABEL, generation); ++ DEBUG_INFO_SECTION_LABEL, ++ init_sections_and_labels_generation); + info_section_emitted = false; + ASM_GENERATE_INTERNAL_LABEL (debug_line_section_label, +- DEBUG_LINE_SECTION_LABEL, generation); ++ DEBUG_LINE_SECTION_LABEL, ++ init_sections_and_labels_generation); + /* There are up to 4 unique ranges labels per generation. + See also output_rnglists. */ + ASM_GENERATE_INTERNAL_LABEL (ranges_section_label, +- DEBUG_RANGES_SECTION_LABEL, generation * 4); ++ DEBUG_RANGES_SECTION_LABEL, ++ init_sections_and_labels_generation * 4); + if (dwarf_version >= 5 && dwarf_split_debug_info) + ASM_GENERATE_INTERNAL_LABEL (ranges_base_label, + DEBUG_RANGES_SECTION_LABEL, +- 1 + generation * 4); ++ 1 + init_sections_and_labels_generation * 4); + ASM_GENERATE_INTERNAL_LABEL (debug_addr_section_label, +- DEBUG_ADDR_SECTION_LABEL, generation); ++ DEBUG_ADDR_SECTION_LABEL, ++ init_sections_and_labels_generation); + ASM_GENERATE_INTERNAL_LABEL (macinfo_section_label, + (dwarf_strict && dwarf_version < 5) + ? DEBUG_MACINFO_SECTION_LABEL +- : DEBUG_MACRO_SECTION_LABEL, generation); ++ : DEBUG_MACRO_SECTION_LABEL, ++ init_sections_and_labels_generation); + ASM_GENERATE_INTERNAL_LABEL (loc_section_label, DEBUG_LOC_SECTION_LABEL, +- generation); ++ init_sections_and_labels_generation); + +- ++generation; +- return generation - 1; ++ ++init_sections_and_labels_generation; ++ return init_sections_and_labels_generation - 1; + } + + /* Set up for Dwarf output at the start of compilation. */ +@@ -32379,6 +32391,8 @@ dwarf2out_c_finalize (void) + base_types.release (); + XDELETEVEC (producer_string); + producer_string = NULL; ++ output_line_info_generation = 0; ++ init_sections_and_labels_generation = 0; + } + + #include "gt-dwarf2out.h" diff --git a/gcc11-pr98765.patch b/gcc11-pr98765.patch new file mode 100644 index 0000000..e4cda36 --- /dev/null +++ b/gcc11-pr98765.patch @@ -0,0 +1,83 @@ +2021-01-20 Jakub Jelinek + + PR debug/98765 + * dwarf2out.c (reset_indirect_string): Also reset indirect strings + with DW_FORM_line_strp form. + (prune_unused_types_update_strings): Don't add into debug_str_hash + indirect strings with DW_FORM_line_strp form. + (adjust_name_comp_dir): New function. + (dwarf2out_finish): Call it on CU DIEs after resetting + debug_line_str_hash. + +--- gcc/dwarf2out.c.jj 2021-01-20 08:32:09.612958930 +0100 ++++ gcc/dwarf2out.c 2021-01-20 15:41:30.343417095 +0100 +@@ -4733,7 +4733,9 @@ int + reset_indirect_string (indirect_string_node **h, void *) + { + struct indirect_string_node *node = *h; +- if (node->form == DW_FORM_strp || node->form == dwarf_FORM (DW_FORM_strx)) ++ if (node->form == DW_FORM_strp ++ || node->form == DW_FORM_line_strp ++ || node->form == dwarf_FORM (DW_FORM_strx)) + { + free (node->label); + node->label = NULL; +@@ -29477,8 +29479,9 @@ prune_unused_types_update_strings (dw_di + s->refcount++; + /* Avoid unnecessarily putting strings that are used less than + twice in the hash table. */ +- if (s->refcount +- == ((DEBUG_STR_SECTION_FLAGS & SECTION_MERGE) ? 1 : 2)) ++ if (s->form != DW_FORM_line_strp ++ && (s->refcount ++ == ((DEBUG_STR_SECTION_FLAGS & SECTION_MERGE) ? 1 : 2))) + { + indirect_string_node **slot + = debug_str_hash->find_slot_with_hash (s->str, +@@ -31325,6 +31328,33 @@ reset_dies (dw_die_ref die) + FOR_EACH_CHILD (die, c, reset_dies (c)); + } + ++/* reset_indirect_string removed the references coming from DW_AT_name ++ and DW_AT_comp_dir attributes on compilation unit DIEs. Readd them as ++ .debug_line_str strings again. */ ++ ++static void ++adjust_name_comp_dir (dw_die_ref die) ++{ ++ for (int i = 0; i < 2; i++) ++ { ++ dwarf_attribute attr_kind = i ? DW_AT_comp_dir : DW_AT_name; ++ dw_attr_node *a = get_AT (die, attr_kind); ++ if (a == NULL || a->dw_attr_val.val_class != dw_val_class_str) ++ continue; ++ ++ if (!debug_line_str_hash) ++ debug_line_str_hash ++ = hash_table::create_ggc (10); ++ ++ struct indirect_string_node *node ++ = find_AT_string_in_table (a->dw_attr_val.v.val_str->str, ++ debug_line_str_hash); ++ set_indirect_string (node); ++ node->form = DW_FORM_line_strp; ++ a->dw_attr_val.v.val_str = node; ++ } ++} ++ + /* Output stuff that dwarf requires at the end of every file, + and generate the DWARF-2 debugging info. */ + +@@ -31398,6 +31428,12 @@ dwarf2out_finish (const char *filename) + { + debug_line_str_hash->traverse (NULL); + debug_line_str_hash = NULL; ++ if (asm_outputs_debug_line_str ()) ++ { ++ adjust_name_comp_dir (comp_unit_die ()); ++ for (limbo_die_node *node = cu_die_list; node; node = node->next) ++ adjust_name_comp_dir (node->die); ++ } + } + } +