Rebase to 11.1.1 by merging from gcc-11.1.1-5.fc35

Resolves: #1951280, #1970929
This commit is contained in:
David Malcolm 2021-06-23 08:48:42 -04:00
parent 56d71cdc5f
commit 033b4958ae
5 changed files with 147 additions and 581 deletions

1
.gitignore vendored
View File

@ -38,3 +38,4 @@
/gcc-11.0.1-20210319.tar.xz
/isl-0.18.tar.bz2
/gcc-11.0.1-20210324.tar.xz
/gcc-11.1.1-20210617.tar.xz

156
gcc.spec
View File

@ -1,10 +1,10 @@
%global DATE 20210324
%global gitrev aae01c864baeefadc9bb5312de389116f77ccb83
%global gcc_version 11.0.1
%global DATE 20210617
%global gitrev f7ca2f99f1015466fd59cd72a3dad1080c230f6a
%global gcc_version 11.1.1
%global gcc_major 11
# Note, gcc_release must be integer, if you want to add suffixes to
# %%{release}, append them after %%{gcc_release} on Release: line.
%global gcc_release 0
%global gcc_release 5
%global nvptx_tools_gitrev 5f6f343a302d620b0868edab376c00b15741e39e
%global newlib_cygwin_gitrev 50e2a63b04bdd018484605fbb954fd1bd5147fa0
%global _unpackaged_files_terminate_build 0
@ -119,7 +119,7 @@
Summary: Various compilers (C, C++, Objective-C, ...)
Name: gcc
Version: %{gcc_version}
Release: %{gcc_release}.3.1%{?dist}
Release: %{gcc_release}%{?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
@ -264,9 +264,7 @@ Patch9: gcc11-foffload-default.patch
Patch10: gcc11-Wno-format-security.patch
Patch11: gcc11-rh1574936.patch
Patch12: gcc11-d-shared-libphobos.patch
Patch13: gcc11-pr91710.patch
Patch14: gcc11-pr99490.patch
Patch15: gcc11-pr99341-revert.patch
Patch13: gcc11-pr99341-revert.patch
Patch100: gcc11-fortran-fdec-duplicates.patch
Patch101: gcc11-fortran-flogical-as-integer.patch
@ -789,9 +787,7 @@ to NVidia PTX capable devices if available.
%patch11 -p0 -b .rh1574936~
%endif
%patch12 -p0 -b .d-shared-libphobos~
%patch13 -p0 -b .pr91710~
%patch14 -p0 -b .pr99490~
%patch15 -p0 -b .pr99341-revert~
%patch13 -p0 -b .pr99341-revert~
%if 0%{?rhel} >= 9
%patch100 -p1 -b .fortran-fdec-duplicates~
@ -3134,10 +3130,148 @@ end
%endif
%changelog
* Thu Jun 17 2021 Jakub Jelinek <jakub@redhat.com> 11.1.1-5
- update from releases/gcc-11-branch
- PRs bootstrap/100731, c++/91706, c++/91859, c++/95719, c++/100065,
c++/100102, c++/100580, c++/100666, c++/100796, c++/100797,
c++/100862, c++/100946, c++/100963, c++/101029, c++/101078, c/100902,
c/100920, d/100882, d/100935, d/100964, d/100967, d/100999,
debug/100852, fortran/82376, fortran/98301, fortran/99839,
fortran/100965, ipa/100791, libstdc++/98842, libstdc++/100475,
libstdc++/100577, libstdc++/100631, libstdc++/100639,
libstdc++/100676, libstdc++/100690, libstdc++/100768,
libstdc++/100770, libstdc++/100824, libstdc++/100833,
libstdc++/100889, libstdc++/100894, libstdc++/100900,
libstdc++/100982, libstdc++/101034, libstdc++/101055,
middle-end/100576, middle-end/100898, middle-end/101009,
preprocessor/100646, rtl-optimization/100342, rtl-optimization/100590,
rtl-optimization/101008, target/100333, target/100885, target/100887,
target/101046, testsuite/100750, tree-optimization/100934,
tree-optimization/100981
* Mon Jun 14 2021 Florian Weimer <fweimer@redhat.com> 11.1.1-4
- NVR bump to enable rebuild in side tag
* Mon May 31 2021 Jakub Jelinek <jakub@redhat.com> 11.1.1-3
- update from releases/gcc-11-branch
- PRs bootstrap/100552, c++/100205, c++/100261, c++/100281, c++/100367,
c++/100372, c++/100489, c++/100502, c++/100634, c++/100644,
c++/100659, c/100550, fortran/98411, fortran/100551, fortran/100602,
fortran/100633, fortran/100656, ipa/100513, libstdc++/100361,
libstdc++/100479, libstdc++/100630, middle-end/100471,
middle-end/100508, middle-end/100509, preprocessor/100392,
target/94177, target/99725, target/99960, target/99977, target/100419,
target/100563, target/100626, target/100767, testsuite/96488,
tree-optimization/100492, tree-optimization/100519
* Wed May 12 2021 Jakub Jelinek <jakub@redhat.com> 11.1.1-2
- update from releases/gcc-11-branch
- PRs c++/98032, c++/100319, c++/100362, c/100450, fortran/100274,
ipa/100308, libgomp/100352, libstdc++/99006, libstdc++/99453,
libstdc++/100259, libstdc++/100298, libstdc++/100384,
rtl-optimization/84878, rtl-optimization/100225,
rtl-optimization/100230, rtl-optimization/100263,
rtl-optimization/100411, target/99988, target/100217, target/100232,
target/100236, target/100270, target/100305, target/100311,
target/100375, target/100402, tree-optimization/96513,
tree-optimization/100253, tree-optimization/100278,
tree-optimization/100329, tree-optimization/100414
- fix build with removed linux/cyclades.h header (PR sanitizer/100379)
- fix up mausezahn miscompilation (#1958887, PR tree-optimization/100566)
* Wed Apr 28 2021 Jakub Jelinek <jakub@redhat.com> 11.1.1-1
- update from releases/gcc-11-branch
- GCC 11.1 release
- PRs c++/93383, c++/95291, c++/96380, c++/99200, c++/99683, c++/100161,
debug/100255, fortran/100154, fortran/100218, libstdc++/100290,
rtl-optimization/100254, target/98952, target/100200,
tree-optimization/100239
- fix ICE in aarch64_add_offset_1_temporaries (PR target/100302)
* Fri Apr 23 2021 Jakub Jelinek <jakub@redhat.com> 11.0.1-0.7
- update from trunk and releases/gcc-11 branch
- GCC 11.1-rc2
- PRs libstdc++/100179, target/100182
* Thu Apr 22 2021 Jakub Jelinek <jakub@redhat.com> 11.0.1-0.6
- update from trunk and releases/gcc-11 branch
- GCC 11.1-rc1
- PRs ada/99360, c++/97536, c/100143, d/98058, d/98457, d/98494, d/98584,
d/99794, demangler/100177, fortran/100110, libstdc++/95983,
libstdc++/100146, libstdc++/100164, preprocessor/100142,
rtl-optimization/99927, target/100108, testsuite/100176,
tree-optimization/100081
- fix a cprop -fcompare-debug bug (PR rtl-optimization/100148)
* Sun Apr 18 2021 Jakub Jelinek <jakub@redhat.com> 11.0.1-0.5
- update from trunk
- PRs analyzer/98599, analyzer/99042, analyzer/99212, analyzer/99774,
analyzer/99886, analyzer/99906, analyzer/100011, c++/41723, c++/49951,
c++/52202, c++/52625, c++/58123, c++/80456, c++/83476, c++/88742,
c++/90215, c++/90479, c++/90674, c++/91241, c++/91849, c++/91933,
c++/92918, c++/93085, c++/93295, c++/93314, c++/93867, c++/94529,
c++/95317, c++/95486, c++/95870, c++/96311, c++/96673, c++/96873,
c++/97121, c++/97134, c++/97679, c++/97974, c++/98440, c++/98800,
c++/98852, c++/99008, c++/99066, c++/99118, c++/99180, c++/99201,
c++/99380, c++/99478, c++/99700, c++/99803, c++/99806, c++/99833,
c++/99844, c++/99850, c++/99859, c++/99874, c++/99885, c++/99899,
c++/99901, c++/99961, c++/99994, c++/100006, c++/100032, c++/100054,
c++/100078, c++/100079, c++/100091, c++/100101, c++/100111, c/98852,
c/99420, c/99972, c/99990, d/99812, d/99914, d/99917, debug/99830,
fortran/63797, fortran/99307, fortran/99817, fortran/100018,
fortran/100094, jit/100096, libfortran/78314, libgomp/99984,
libstdc++/96657, libstdc++/99402, libstdc++/99433, libstdc++/99805,
libstdc++/99985, libstdc++/99995, libstdc++/100044, libstdc++/100060,
lto/98599, lto/99849, lto/99857, middle-end/55288, middle-end/84877,
middle-end/84991, middle-end/84992, middle-end/86058,
middle-end/90779, middle-end/98088, middle-end/99883,
middle-end/99989, preprocessor/99446, rtl-optimization/98601,
rtl-optimization/98689, rtl-optimization/99596,
rtl-optimization/99905, rtl-optimization/99929,
rtl-optimization/100066, sanitizer/99877, sanitizer/100114,
target/87763, target/99246, target/99647, target/99648, target/99748,
target/99767, target/99781, target/99872, target/100028,
target/100048, target/100056, target/100067, target/100075,
testsuite/99955, testsuite/100071, testsuite/100073,
tree-optimization/82800, tree-optimization/97513,
tree-optimization/98736, tree-optimization/99873,
tree-optimization/99880, tree-optimization/99924,
tree-optimization/99947, tree-optimization/99954,
tree-optimization/100053
- for %%{rhel} == 9, default to -march=z14 -mtune=z15 on s390x and
to -mcpu=power9 -mtune=power9 on ppc64le
* Fri Apr 9 2021 Marek Polacek <polacek@redhat.com> 11.0.1-0.3.1
- for %%{rhel} == 9, default to -march=z14 -mtune=z15 on s390x and
to -mcpu=power9 -mtune=power9 on ppc64le
* Mon Apr 5 2021 Jakub Jelinek <jakub@redhat.com> 11.0.1-0.4
- update from trunk
- PRs ada/99802, analyzer/93695, analyzer/99044, analyzer/99716,
analyzer/99771, bootstrap/98860, c++/90664, c++/91217, c++/91416,
c++/94751, c++/97900, c++/97938, c++/98352, c++/99331, c++/99445,
c++/99565, c++/99583, c++/99584, c++/99586, c++/99643, c++/99672,
c++/99705, c++/99745, c++/99790, c++/99815, c++/99831, c++/99869,
d/91595, d/99691, debug/99334, fortran/99369, fortran/99602,
fortran/99651, fortran/99818, fortran/99840, ipa/98265, ipa/99122,
ipa/99466, ipa/99751, libstdc++/99533, lto/99447, middle-end/65182,
rtl-optimization/97141, rtl-optimization/98726,
rtl-optimization/99863, target/96974, target/97653, target/98119,
target/98136, target/98209, target/99037, target/99133, target/99216,
target/99555, target/99718, target/99724, target/99727, target/99744,
target/99753, target/99766, target/99773, target/99786, target/99808,
target/99813, target/99820, target/99822, testsuite/98125,
tree-optimization/48483, tree-optimization/55060,
tree-optimization/59970, tree-optimization/61112,
tree-optimization/61677, tree-optimization/61869,
tree-optimization/96573, tree-optimization/96974,
tree-optimization/97009, tree-optimization/98268,
tree-optimization/99726, tree-optimization/99746,
tree-optimization/99777, tree-optimization/99807,
tree-optimization/99824, tree-optimization/99825,
tree-optimization/99856, tree-optimization/99863,
tree-optimization/99882
* Wed Mar 24 2021 Jakub Jelinek <jakub@redhat.com> 11.0.1-0.3
- update from trunk
- PRs analyzer/99614, c++/99239, c++/99283, c++/99318, c++/99425, c++/99456,

View File

@ -1,96 +0,0 @@
2021-03-18 Jakub Jelinek <jakub@redhat.com>
PR target/91710
* config/aarch64/aarch64.c (aarch64_function_arg_alignment): Change
abi_break argument from bool * to unsigned *, store there the pre-GCC 9
alignment.
(aarch64_layout_arg, aarch64_gimplify_va_arg_expr): Adjust callers.
(aarch64_function_arg_regno_p): Likewise. Only emit -Wpsabi note if
the old and new alignment after applying MIN/MAX to it is different.
* gcc.target/aarch64/pr91710.c: New test.
--- gcc/config/aarch64/aarch64.c.jj 2021-03-18 15:14:51.721425223 +0100
+++ gcc/config/aarch64/aarch64.c 2021-03-18 16:35:04.437115447 +0100
@@ -5938,9 +5938,9 @@ aarch64_vfp_is_call_candidate (cumulativ
static unsigned int
aarch64_function_arg_alignment (machine_mode mode, const_tree type,
- bool *abi_break)
+ unsigned int *abi_break)
{
- *abi_break = false;
+ *abi_break = 0;
if (!type)
return GET_MODE_ALIGNMENT (mode);
@@ -5982,7 +5982,7 @@ aarch64_function_arg_alignment (machine_
if (bitfield_alignment > alignment)
{
- *abi_break = true;
+ *abi_break = alignment;
return bitfield_alignment;
}
@@ -6004,7 +6004,7 @@ aarch64_layout_arg (cumulative_args_t pc
int ncrn, nvrn, nregs;
bool allocate_ncrn, allocate_nvrn;
HOST_WIDE_INT size;
- bool abi_break;
+ unsigned int abi_break;
/* We need to do this once per argument. */
if (pcum->aapcs_arg_processed)
@@ -6322,14 +6322,19 @@ aarch64_function_arg_regno_p (unsigned r
static unsigned int
aarch64_function_arg_boundary (machine_mode mode, const_tree type)
{
- bool abi_break;
+ unsigned int abi_break;
unsigned int alignment = aarch64_function_arg_alignment (mode, type,
&abi_break);
+ alignment = MIN (MAX (alignment, PARM_BOUNDARY), STACK_BOUNDARY);
if (abi_break & warn_psabi)
- inform (input_location, "parameter passing for argument of type "
- "%qT changed in GCC 9.1", type);
+ {
+ abi_break = MIN (MAX (abi_break, PARM_BOUNDARY), STACK_BOUNDARY);
+ if (alignment != abi_break)
+ inform (input_location, "parameter passing for argument of type "
+ "%qT changed in GCC 9.1", type);
+ }
- return MIN (MAX (alignment, PARM_BOUNDARY), STACK_BOUNDARY);
+ return alignment;
}
/* Implement TARGET_GET_RAW_RESULT_MODE and TARGET_GET_RAW_ARG_MODE. */
@@ -16616,7 +16621,7 @@ aarch64_gimplify_va_arg_expr (tree valis
f_stack, NULL_TREE);
size = int_size_in_bytes (type);
- bool abi_break;
+ unsigned int abi_break;
align
= aarch64_function_arg_alignment (mode, type, &abi_break) / BITS_PER_UNIT;
--- gcc/testsuite/gcc.target/aarch64/pr91710.c.jj 2021-03-18 16:42:33.529232710 +0100
+++ gcc/testsuite/gcc.target/aarch64/pr91710.c 2021-03-18 16:42:07.271518121 +0100
@@ -0,0 +1,16 @@
+/* PR target/91710 */
+/* { dg-do compile } */
+
+struct S { unsigned int i:4; };
+
+unsigned int test1(struct S s) { /* { dg-bogus "parameter passing for argument of type" } */
+ return s.i;
+}
+
+unsigned int test2(unsigned x, struct S s) { /* { dg-bogus "parameter passing for argument of type" } */
+ return x - s.i;
+}
+
+unsigned int test3(unsigned x, unsigned y, struct S s) { /* { dg-bogus "parameter passing for argument of type" } */
+ return x - y - s.i;
+}

View File

@ -1,473 +0,0 @@
2021-03-12 Jakub Jelinek <jakub@redhat.com>
PR debug/99490
* dwarf2out.c (debug_ranges_dwo_section): New variable.
(DW_RANGES_IDX_SKELETON): Define.
(struct dw_ranges): Add begin_entry and end_entry members.
(DEBUG_DWO_RNGLISTS_SECTION): Define.
(add_ranges_num): Adjust r initializer for addition of *_entry
members.
(add_ranges_by_labels): For -gsplit-dwarf and force_direct,
set idx to DW_RANGES_IDX_SKELETON.
(index_rnglists): Don't set r->idx if it is equal to
DW_RANGES_IDX_SKELETON. Initialize r->begin_entry and
r->end_entry for -gsplit-dwarf if those will be needed by
output_rnglists.
(output_rnglists): Add DWO argument. If true, switch to
debug_ranges_dwo_section rather than debug_ranges_section.
Adjust l1/l2 label indexes. Only output the offset table when
dwo is true and don't include in there the skeleton range
entry if present. For -gsplit-dwarf, skip ranges that belong
to the other rnglists section. Change return type from void
to bool and return true if there are any range entries for
the other section. For dwarf_split_debug_info use
DW_RLE_startx_endx, DW_RLE_startx_length and DW_RLE_base_addressx
entries instead of DW_RLE_start_end, DW_RLE_start_length and
DW_RLE_base_address.
(init_sections_and_labels): Initialize debug_ranges_dwo_section
if -gsplit-dwarf and DWARF >= 5. Adjust ranges_section_label
and range_base_label indexes.
(dwarf2out_finish): Call index_rnglists earlier before finalizing
.debug_addr. Never emit DW_AT_rnglists_base attribute. For
-gsplit-dwarf and DWARF >= 5 call output_rnglists up to twice
with different dwo arguments.
(dwarf2out_c_finalize): Clear debug_ranges_dwo_section.
--- gcc/dwarf2out.c.jj 2021-03-10 17:36:37.037537129 +0100
+++ gcc/dwarf2out.c 2021-03-11 12:50:00.402418873 +0100
@@ -171,6 +171,7 @@ static GTY(()) section *debug_line_str_s
static GTY(()) section *debug_str_dwo_section;
static GTY(()) section *debug_str_offsets_section;
static GTY(()) section *debug_ranges_section;
+static GTY(()) section *debug_ranges_dwo_section;
static GTY(()) section *debug_frame_section;
/* Maximum size (in bytes) of an artificially generated label. */
@@ -3152,11 +3153,17 @@ struct GTY(()) dw_ranges {
/* If this is positive, it's a block number, otherwise it's a
bitwise-negated index into dw_ranges_by_label. */
int num;
+ /* If idx is equal to DW_RANGES_IDX_SKELETON, it should be emitted
+ into .debug_rnglists section rather than .debug_rnglists.dwo
+ for -gsplit-dwarf and DWARF >= 5. */
+#define DW_RANGES_IDX_SKELETON ((1U << 31) - 1)
/* Index for the range list for DW_FORM_rnglistx. */
unsigned int idx : 31;
/* True if this range might be possibly in a different section
from previous entry. */
unsigned int maybe_new_sec : 1;
+ addr_table_entry *begin_entry;
+ addr_table_entry *end_entry;
};
/* A structure to hold a macinfo entry. */
@@ -4099,6 +4106,9 @@ new_addr_loc_descr (rtx addr, enum dtpre
#ifndef DEBUG_RNGLISTS_SECTION
#define DEBUG_RNGLISTS_SECTION ".debug_rnglists"
#endif
+#ifndef DEBUG_DWO_RNGLISTS_SECTION
+#define DEBUG_DWO_RNGLISTS_SECTION ".debug_rnglists.dwo"
+#endif
#ifndef DEBUG_LINE_STR_SECTION
#define DEBUG_LINE_STR_SECTION ".debug_line_str"
#endif
@@ -11751,7 +11761,7 @@ output_aranges (void)
static unsigned int
add_ranges_num (int num, bool maybe_new_sec)
{
- dw_ranges r = { NULL, num, 0, maybe_new_sec };
+ dw_ranges r = { NULL, num, 0, maybe_new_sec, NULL, NULL };
vec_safe_push (ranges_table, r);
return vec_safe_length (ranges_table) - 1;
}
@@ -11796,6 +11806,8 @@ add_ranges_by_labels (dw_die_ref die, co
add_AT_range_list (die, DW_AT_ranges, offset, force_direct);
*added = true;
note_rnglist_head (offset);
+ if (dwarf_split_debug_info && force_direct)
+ (*ranges_table)[offset].idx = DW_RANGES_IDX_SKELETON;
}
}
@@ -11921,23 +11933,87 @@ asm_outputs_debug_line_str (void)
}
-/* Assign .debug_rnglists indexes. */
+/* Assign .debug_rnglists indexes and unique indexes into the debug_addr
+ section when needed. */
static void
index_rnglists (void)
{
unsigned i;
dw_ranges *r;
+ bool base = false;
+ unsigned int len = vec_safe_length (ranges_table);
FOR_EACH_VEC_SAFE_ELT (ranges_table, i, r)
- if (r->label)
- r->idx = rnglist_idx++;
+ {
+ if (r->label && r->idx != DW_RANGES_IDX_SKELETON)
+ r->idx = rnglist_idx++;
+
+ if (!have_multiple_function_sections)
+ continue;
+ int block_num = r->num;
+ if (HAVE_AS_LEB128 && (r->label || r->maybe_new_sec))
+ base = false;
+ if (block_num > 0)
+ {
+ char blabel[MAX_ARTIFICIAL_LABEL_BYTES];
+ char elabel[MAX_ARTIFICIAL_LABEL_BYTES];
+
+ ASM_GENERATE_INTERNAL_LABEL (blabel, BLOCK_BEGIN_LABEL, block_num);
+ ASM_GENERATE_INTERNAL_LABEL (elabel, BLOCK_END_LABEL, block_num);
+
+ if (HAVE_AS_LEB128)
+ {
+ if (!base)
+ {
+ dw_ranges *r2 = NULL;
+ if (i < len - 1)
+ r2 = &(*ranges_table)[i + 1];
+ if (r2
+ && r2->num != 0
+ && r2->label == NULL
+ && !r2->maybe_new_sec)
+ {
+ r->begin_entry
+ = add_addr_table_entry (xstrdup (blabel),
+ ate_kind_label);
+ base = true;
+ }
+ }
+ if (base)
+ continue;
+ r->begin_entry
+ = add_addr_table_entry (xstrdup (blabel), ate_kind_label);
+ }
+ else
+ {
+ r->begin_entry
+ = add_addr_table_entry (xstrdup (blabel), ate_kind_label);
+ r->end_entry
+ = add_addr_table_entry (xstrdup (elabel), ate_kind_label);
+ }
+ }
+
+ /* Negative block_num stands for an index into ranges_by_label. */
+ else if (block_num < 0)
+ {
+ int lab_idx = - block_num - 1;
+ const char *blabel = (*ranges_by_label)[lab_idx].begin;
+ const char *elabel = (*ranges_by_label)[lab_idx].end;
+
+ r->begin_entry
+ = add_addr_table_entry (xstrdup (blabel), ate_kind_label);
+ if (!HAVE_AS_LEB128)
+ r->end_entry
+ = add_addr_table_entry (xstrdup (elabel), ate_kind_label);
+ }
+ }
}
-/* Emit .debug_rnglists section. */
+/* Emit .debug_rnglists or (when DWO is true) .debug_rnglists.dwo section. */
-static void
-output_rnglists (unsigned generation)
+static bool
+output_rnglists (unsigned generation, bool dwo)
{
unsigned i;
dw_ranges *r;
@@ -11945,14 +12021,19 @@ output_rnglists (unsigned generation)
char l2[MAX_ARTIFICIAL_LABEL_BYTES];
char basebuf[MAX_ARTIFICIAL_LABEL_BYTES];
- switch_to_section (debug_ranges_section);
- ASM_OUTPUT_LABEL (asm_out_file, ranges_section_label);
+ if (dwo)
+ switch_to_section (debug_ranges_dwo_section);
+ else
+ {
+ switch_to_section (debug_ranges_section);
+ ASM_OUTPUT_LABEL (asm_out_file, ranges_section_label);
+ }
/* There are up to 4 unique ranges labels per generation.
See also init_sections_and_labels. */
ASM_GENERATE_INTERNAL_LABEL (l1, DEBUG_RANGES_SECTION_LABEL,
- 2 + generation * 4);
+ 2 + 2 * dwo + generation * 6);
ASM_GENERATE_INTERNAL_LABEL (l2, DEBUG_RANGES_SECTION_LABEL,
- 3 + generation * 4);
+ 3 + 2 * dwo + generation * 6);
if (DWARF_INITIAL_LENGTH_SIZE - dwarf_offset_size == 4)
dw2_asm_output_data (4, 0xffffffff,
"Initial length escape value indicating "
@@ -11969,13 +12050,13 @@ output_rnglists (unsigned generation)
the offset table plus corresponding DW_FORM_rnglistx uleb128 indexes
into it are usually larger than just DW_FORM_sec_offset offsets
into the .debug_rnglists section. */
- dw2_asm_output_data (4, dwarf_split_debug_info ? rnglist_idx : 0,
+ dw2_asm_output_data (4, dwo ? rnglist_idx : 0,
"Offset Entry Count");
- if (dwarf_split_debug_info)
+ if (dwo)
{
ASM_OUTPUT_LABEL (asm_out_file, ranges_base_label);
FOR_EACH_VEC_SAFE_ELT (ranges_table, i, r)
- if (r->label)
+ if (r->label && r->idx != DW_RANGES_IDX_SKELETON)
dw2_asm_output_delta (dwarf_offset_size, r->label,
ranges_base_label, NULL);
}
@@ -11983,15 +12064,32 @@ output_rnglists (unsigned generation)
const char *lab = "";
unsigned int len = vec_safe_length (ranges_table);
const char *base = NULL;
+ bool skipping = false;
+ bool ret = false;
FOR_EACH_VEC_SAFE_ELT (ranges_table, i, r)
{
int block_num = r->num;
if (r->label)
{
+ if (dwarf_split_debug_info)
+ {
+ if ((r->idx == DW_RANGES_IDX_SKELETON) == dwo)
+ {
+ ret = true;
+ skipping = true;
+ continue;
+ }
+ }
ASM_OUTPUT_LABEL (asm_out_file, r->label);
lab = r->label;
}
+ if (skipping)
+ {
+ if (block_num == 0)
+ skipping = false;
+ continue;
+ }
if (HAVE_AS_LEB128 && (r->label || r->maybe_new_sec))
base = NULL;
if (block_num > 0)
@@ -12027,10 +12125,23 @@ output_rnglists (unsigned generation)
&& r2->label == NULL
&& !r2->maybe_new_sec)
{
- dw2_asm_output_data (1, DW_RLE_base_address,
- "DW_RLE_base_address (%s)", lab);
- dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel,
- "Base address (%s)", lab);
+ if (dwarf_split_debug_info)
+ {
+ dw2_asm_output_data (1, DW_RLE_base_addressx,
+ "DW_RLE_base_addressx (%s)",
+ lab);
+ dw2_asm_output_data_uleb128 (r->begin_entry->index,
+ "Base address index "
+ "(%s)", blabel);
+ }
+ else
+ {
+ dw2_asm_output_data (1, DW_RLE_base_address,
+ "DW_RLE_base_address (%s)",
+ lab);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel,
+ "Base address (%s)", lab);
+ }
strcpy (basebuf, blabel);
base = basebuf;
}
@@ -12045,13 +12156,35 @@ output_rnglists (unsigned generation)
"Range end address (%s)", lab);
continue;
}
- dw2_asm_output_data (1, DW_RLE_start_length,
- "DW_RLE_start_length (%s)", lab);
- dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel,
- "Range begin address (%s)", lab);
+ if (dwarf_split_debug_info)
+ {
+ dw2_asm_output_data (1, DW_RLE_startx_length,
+ "DW_RLE_startx_length (%s)", lab);
+ dw2_asm_output_data_uleb128 (r->begin_entry->index,
+ "Range begin address index "
+ "(%s)", blabel);
+ }
+ else
+ {
+ dw2_asm_output_data (1, DW_RLE_start_length,
+ "DW_RLE_start_length (%s)", lab);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel,
+ "Range begin address (%s)", lab);
+ }
dw2_asm_output_delta_uleb128 (elabel, blabel,
"Range length (%s)", lab);
}
+ else if (dwarf_split_debug_info)
+ {
+ dw2_asm_output_data (1, DW_RLE_startx_endx,
+ "DW_RLE_startx_endx (%s)", lab);
+ dw2_asm_output_data_uleb128 (r->begin_entry->index,
+ "Range begin address index "
+ "(%s)", blabel);
+ dw2_asm_output_data_uleb128 (r->end_entry->index,
+ "Range end address index "
+ "(%s)", elabel);
+ }
else
{
dw2_asm_output_data (1, DW_RLE_start_end,
@@ -12074,13 +12207,35 @@ output_rnglists (unsigned generation)
gcc_unreachable ();
if (HAVE_AS_LEB128)
{
- dw2_asm_output_data (1, DW_RLE_start_length,
- "DW_RLE_start_length (%s)", lab);
- dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel,
- "Range begin address (%s)", lab);
+ if (dwarf_split_debug_info)
+ {
+ dw2_asm_output_data (1, DW_RLE_startx_length,
+ "DW_RLE_startx_length (%s)", lab);
+ dw2_asm_output_data_uleb128 (r->begin_entry->index,
+ "Range begin address index "
+ "(%s)", blabel);
+ }
+ else
+ {
+ dw2_asm_output_data (1, DW_RLE_start_length,
+ "DW_RLE_start_length (%s)", lab);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel,
+ "Range begin address (%s)", lab);
+ }
dw2_asm_output_delta_uleb128 (elabel, blabel,
"Range length (%s)", lab);
}
+ else if (dwarf_split_debug_info)
+ {
+ dw2_asm_output_data (1, DW_RLE_startx_endx,
+ "DW_RLE_startx_endx (%s)", lab);
+ dw2_asm_output_data_uleb128 (r->begin_entry->index,
+ "Range begin address index "
+ "(%s)", blabel);
+ dw2_asm_output_data_uleb128 (r->end_entry->index,
+ "Range end address index "
+ "(%s)", elabel);
+ }
else
{
dw2_asm_output_data (1, DW_RLE_start_end,
@@ -12096,6 +12251,7 @@ output_rnglists (unsigned generation)
"DW_RLE_end_of_list (%s)", lab);
}
ASM_OUTPUT_LABEL (asm_out_file, l2);
+ return ret;
}
/* Data structure containing information about input files. */
@@ -28823,6 +28979,10 @@ init_sections_and_labels (bool early_lto
debug_macinfo_section = get_section (debug_macinfo_section_name,
SECTION_DEBUG | SECTION_EXCLUDE,
NULL);
+ if (dwarf_version >= 5)
+ debug_ranges_dwo_section
+ = get_section (DEBUG_DWO_RNGLISTS_SECTION,
+ SECTION_DEBUG | SECTION_EXCLUDE, NULL);
}
debug_aranges_section = get_section (DEBUG_ARANGES_SECTION,
SECTION_DEBUG, NULL);
@@ -28857,15 +29017,15 @@ init_sections_and_labels (bool early_lto
ASM_GENERATE_INTERNAL_LABEL (debug_line_section_label,
DEBUG_LINE_SECTION_LABEL,
init_sections_and_labels_generation);
- /* There are up to 4 unique ranges labels per generation.
+ /* There are up to 6 unique ranges labels per generation.
See also output_rnglists. */
ASM_GENERATE_INTERNAL_LABEL (ranges_section_label,
DEBUG_RANGES_SECTION_LABEL,
- init_sections_and_labels_generation * 4);
+ init_sections_and_labels_generation * 6);
if (dwarf_version >= 5 && dwarf_split_debug_info)
ASM_GENERATE_INTERNAL_LABEL (ranges_base_label,
DEBUG_RANGES_SECTION_LABEL,
- 1 + init_sections_and_labels_generation * 4);
+ 1 + init_sections_and_labels_generation * 6);
ASM_GENERATE_INTERNAL_LABEL (debug_addr_section_label,
DEBUG_ADDR_SECTION_LABEL,
init_sections_and_labels_generation);
@@ -31665,6 +31825,9 @@ dwarf2out_finish (const char *filename)
index_location_lists (comp_unit_die ());
}
+ if (dwarf_version >= 5 && !vec_safe_is_empty (ranges_table))
+ index_rnglists ();
+
if (addr_index_table != NULL)
{
unsigned int index = 0;
@@ -31730,9 +31893,6 @@ dwarf2out_finish (const char *filename)
int mark;
struct md5_ctx ctx;
- if (dwarf_version >= 5 && !vec_safe_is_empty (ranges_table))
- index_rnglists ();
-
/* Compute a checksum of the comp_unit to use as the dwo_id. */
md5_init_ctx (&ctx);
mark = 0;
@@ -31752,10 +31912,7 @@ dwarf2out_finish (const char *filename)
comp-unit DIE. */
if (!vec_safe_is_empty (ranges_table))
{
- if (dwarf_version >= 5)
- add_AT_lineptr (main_comp_unit_die, DW_AT_rnglists_base,
- ranges_base_label);
- else
+ if (dwarf_version < 5)
add_AT_lineptr (main_comp_unit_die, DW_AT_GNU_ranges_base,
ranges_section_label);
}
@@ -31833,7 +31990,26 @@ dwarf2out_finish (const char *filename)
if (!vec_safe_is_empty (ranges_table))
{
if (dwarf_version >= 5)
- output_rnglists (generation);
+ {
+ if (dwarf_split_debug_info)
+ {
+ /* We don't know right now whether there are any
+ ranges for .debug_rnglists and any for .debug_rnglists.dwo.
+ Depending on into which of those two belongs the first
+ ranges_table entry, emit that section first and that
+ output_rnglists call will return if the other kind of
+ ranges needs to be emitted as well. */
+ if ((*ranges_table)[0].idx == DW_RANGES_IDX_SKELETON)
+ {
+ if (output_rnglists (generation, false))
+ output_rnglists (generation, true);
+ }
+ else if (output_rnglists (generation, true))
+ output_rnglists (generation, false);
+ }
+ else
+ output_rnglists (generation, false);
+ }
else
output_ranges ();
}
@@ -32457,6 +32633,7 @@ dwarf2out_c_finalize (void)
debug_str_dwo_section = NULL;
debug_str_offsets_section = NULL;
debug_ranges_section = NULL;
+ debug_ranges_dwo_section = NULL;
debug_frame_section = NULL;
fde_vec = NULL;
debug_str_hash = NULL;

View File

@ -1,4 +1,4 @@
SHA512 (gcc-11.0.1-20210324.tar.xz) = 3f7fb2bb2098b021efe5e3dcf128a91525adc49ace1ad4120bbccc95827c45affe9beacfff43b03a0da30fcb6f8ea1a22ab7bd05f2aed05b0541f8c2ca4cfd0c
SHA512 (gcc-11.1.1-20210617.tar.xz) = d39082995a1a2dc577b290c44c894ce7f819e30d58ad0697366e38112772a5cb9ea60213db416ce34b4a7f0f0d80dd9087ddab7279bd8018e0e5c20dadf49256
SHA512 (isl-0.18.tar.bz2) = 85d0b40f4dbf14cb99d17aa07048cdcab2dc3eb527d2fbb1e84c41b2de5f351025370e57448b63b2b8a8cf8a0843a089c3263f9baee1542d5c2e1cb37ed39d94
SHA512 (newlib-cygwin-50e2a63b04bdd018484605fbb954fd1bd5147fa0.tar.xz) = 002a48a7b689a81abbf16161bcaec001a842e67dfbe372e9e109092703bfc666675f16198f60ca429370e8850d564547dc505df81bc3aaca4ce6defbc014ad6c
SHA512 (nvptx-tools-5f6f343a302d620b0868edab376c00b15741e39e.tar.xz) = f6d10db94fa1570ae0f94df073fa3c73c8e5ee16d59070b53d94f7db0de8a031bc44d7f3f1852533da04b625ce758e022263855ed43cfc6867e0708d001e53c7