diff --git a/.gitignore b/.gitignore index afef67f..5b2898a 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,7 @@ /gcc-11.0.0-20210130.tar.xz /gcc-11.0.0-20210210.tar.xz /gcc-11.0.0-20210225.tar.xz +/gcc-11.0.1-20210307.tar.xz +/gcc-11.0.1-20210319.tar.xz +/isl-0.18.tar.bz2 +/gcc-11.0.1-20210324.tar.xz diff --git a/gcc.spec b/gcc.spec index 0089508..40465a2 100644 --- a/gcc.spec +++ b/gcc.spec @@ -1,6 +1,6 @@ -%global DATE 20210225 -%global gitrev 441dcf7e3bfd4aae42bb0d520cfc904fb14f84aa -%global gcc_version 11.0.0 +%global DATE 20210324 +%global gitrev aae01c864baeefadc9bb5312de389116f77ccb83 +%global gcc_version 11.0.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. @@ -119,7 +119,7 @@ Summary: Various compilers (C, C++, Objective-C, ...) Name: gcc Version: %{gcc_version} -Release: %{gcc_release}.20%{?dist} +Release: %{gcc_release}.3%{?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 @@ -145,7 +145,8 @@ Source1: nvptx-tools-%{nvptx_tools_gitrev}.tar.xz # git --git-dir=newlib-cygwin-dir.tmp/.git archive --prefix=newlib-cygwin-%%{newlib_cygwin_gitrev}/ %%{newlib_cygwin_gitrev} ":(exclude)newlib/libc/sys/linux/include/rpc/*.[hx]" | xz -9e > newlib-cygwin-%%{newlib_cygwin_gitrev}.tar.xz # rm -rf newlib-cygwin-dir.tmp Source2: newlib-cygwin-%{newlib_cygwin_gitrev}.tar.xz -%global isl_version 0.16.1 +%global isl_version 0.18 +Source3: https://gcc.gnu.org/pub/gcc/infrastructure/isl-%{isl_version}.tar.bz2 URL: http://gcc.gnu.org # Need binutils with -pie support >= 2.14.90.0.4-4 # Need binutils which can omit dot symbols and overlap .opd on ppc64 >= 2.15.91.0.2-4 @@ -201,15 +202,6 @@ BuildRequires: gcc-gnat >= 3.1, libgnat >= 3.1 %ifarch ia64 BuildRequires: libunwind >= 0.98 %endif -%if %{build_isl} -BuildRequires: isl = %{isl_version} -BuildRequires: isl-devel = %{isl_version} -%if 0%{?__isa_bits} == 64 -Requires: libisl.so.15()(64bit) -%else -Requires: libisl.so.15 -%endif -%endif %if %{build_libstdcxx_docs} BuildRequires: doxygen >= 1.7.1 BuildRequires: graphviz, dblatex, texlive-collection-latex, docbook5-style-xsl @@ -265,13 +257,16 @@ Patch2: gcc11-sparc-config-detection.patch Patch3: gcc11-libgomp-omp_h-multilib.patch Patch4: gcc11-libtool-no-rpath.patch Patch5: gcc11-isl-dl.patch -Patch6: gcc11-libstdc++-docs.patch -Patch7: gcc11-no-add-needed.patch -Patch8: gcc11-foffload-default.patch -Patch9: gcc11-Wno-format-security.patch -Patch10: gcc11-rh1574936.patch -Patch11: gcc11-d-shared-libphobos.patch -Patch12: gcc11-pr98338-workaround.patch +Patch6: gcc11-isl-dl2.patch +Patch7: gcc11-libstdc++-docs.patch +Patch8: gcc11-no-add-needed.patch +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 Patch100: gcc11-fortran-fdec-duplicates.patch Patch101: gcc11-fortran-flogical-as-integer.patch @@ -775,25 +770,28 @@ by default add PTX code into the binaries, which can be offloaded to NVidia PTX capable devices if available. %prep -%setup -q -n gcc-%{version}-%{DATE} -a 1 -a 2 +%setup -q -n gcc-%{version}-%{DATE} -a 1 -a 2 -a 3 %patch0 -p0 -b .hack~ %patch2 -p0 -b .sparc-config-detection~ %patch3 -p0 -b .libgomp-omp_h-multilib~ %patch4 -p0 -b .libtool-no-rpath~ %if %{build_isl} %patch5 -p0 -b .isl-dl~ +%patch6 -p0 -b .isl-dl2~ %endif %if %{build_libstdcxx_docs} -%patch6 -p0 -b .libstdc++-docs~ +%patch7 -p0 -b .libstdc++-docs~ %endif -%patch7 -p0 -b .no-add-needed~ -%patch8 -p0 -b .foffload-default~ -%patch9 -p0 -b .Wno-format-security~ +%patch8 -p0 -b .no-add-needed~ +%patch9 -p0 -b .foffload-default~ +%patch10 -p0 -b .Wno-format-security~ %if 0%{?fedora} >= 29 || 0%{?rhel} > 7 -%patch10 -p0 -b .rh1574936~ +%patch11 -p0 -b .rh1574936~ %endif -%patch11 -p0 -b .d-shared-libphobos~ -%patch12 -p0 -b .pr98338-workaround~ +%patch12 -p0 -b .d-shared-libphobos~ +%patch13 -p0 -b .pr91710~ +%patch14 -p0 -b .pr99490~ +%patch15 -p0 -b .pr99341-revert~ %if 0%{?rhel} >= 9 %patch100 -p1 -b .fortran-fdec-duplicates~ @@ -808,7 +806,6 @@ to NVidia PTX capable devices if available. %patch109 -p1 -b .fortran-fdec-add-missing-indexes~ %endif -rm -f libgomp/testsuite/*/*task-detach* %ifarch %{arm} rm -f gcc/testsuite/go.test/test/fixedbugs/issue19182.go %endif @@ -909,6 +906,28 @@ rm -rf obj-%{gcc_target_platform} mkdir obj-%{gcc_target_platform} cd obj-%{gcc_target_platform} +%if %{build_isl} +mkdir isl-build isl-install +%ifarch s390 s390x +ISL_FLAG_PIC=-fPIC +%else +ISL_FLAG_PIC=-fpic +%endif +cd isl-build +sed -i 's|libisl|libgcc11privateisl|g' \ + ../../isl-%{isl_version}/Makefile.{am,in} +../../isl-%{isl_version}/configure \ + CC=/usr/bin/gcc CXX=/usr/bin/g++ \ + CFLAGS="${CFLAGS:-%optflags} $ISL_FLAG_PIC" --prefix=`cd ..; pwd`/isl-install +make %{?_smp_mflags} +make install +cd ../isl-install/lib +rm libgcc11privateisl.so{,.15} +mv libgcc11privateisl.so.15.3.0 libisl.so.15 +ln -sf libisl.so.15 libisl.so +cd ../.. +%endif + enablelgo= enablelada= enablelobjc= @@ -952,7 +971,7 @@ CONFIGURE_OPTS="\ %endif --enable-plugin --enable-initfini-array \ %if %{build_isl} - --with-isl \ + --with-isl=`pwd`/isl-install \ %else --without-isl \ %endif @@ -1096,6 +1115,10 @@ make jit.sphinx.html make jit.sphinx.install-html jit_htmldir=`pwd`/../../rpm.doc/libgccjit-devel/html cd .. +%if %{build_isl} +cp -a isl-install/lib/libisl.so.15 gcc/ +%endif + # Make generated man pages even if Pod::Man is not new enough perl -pi -e 's/head3/head2/' ../contrib/texi2pod.pl for i in ../gcc/doc/*.texi; do @@ -1222,6 +1245,10 @@ chmod 644 %{buildroot}%{_infodir}/gnat* FULLPATH=%{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major} FULLEPATH=%{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major} +%if %{build_isl} +cp -a isl-install/lib/libisl.so.15 $FULLPATH/ +%endif + # fix some things ln -sf gcc %{buildroot}%{_prefix}/bin/cc rm -f %{buildroot}%{_prefix}/lib/cpp @@ -2295,6 +2322,9 @@ end %if %{build_libasan} %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libsanitizer.spec %endif +%if %{build_isl} +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libisl.so.* +%endif %ifarch sparcv9 ppc %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/crt*.o @@ -3096,6 +3126,72 @@ end %endif %changelog +* Wed Mar 24 2021 Jakub Jelinek 11.0.1-0.3 +- update from trunk + - PRs analyzer/99614, c++/99239, c++/99283, c++/99318, c++/99425, c++/99456, + c++/99480, c++/99687, c/99588, fortran/93660, fortran/99688, + rtl-optimization/99680, target/97252, target/97926, target/98914, + target/99540, target/99581, target/99652, target/99660, target/99661, + target/99663, target/99679, target/99702, target/99704, target/99733, + tree-optimization/99296, tree-optimization/99656, + tree-optimization/99694, tree-optimization/99721 + +* Fri Mar 19 2021 Jakub Jelinek 11.0.1-0.2 +- update from trunk + - PRs c++/90448, c++/96268, c++/96749, c++/97973, c++/98480, c++/98704, + c++/99047, c++/99108, c++/99238, c++/99248, c++/99285, c++/99423, + c++/99436, c++/99459, c++/99472, c++/99496, c++/99500, c++/99507, + c++/99508, c++/99509, c++/99528, c++/99601, c++/99613, c++/99617, + fortran/49278, fortran/96983, fortran/97927, fortran/98858, + fortran/99125, fortran/99205, fortran/99345, fortran/99514, + fortran/99545, ipa/99517, libstdc++/99172, libstdc++/99341, + libstdc++/99413, libstdc++/99536, libstdc++/99537, middle-end/97631, + middle-end/98266, middle-end/99502, middle-end/99641, objc++/49070, + sanitizer/98920, target/98092, target/98959, target/99070, + target/99094, target/99102, target/99422, target/99437, target/99454, + target/99463, target/99464, target/99492, target/99504, target/99542, + target/99563, target/99592, target/99600, testsuite/97680, + testsuite/98245, testsuite/99292, testsuite/99498, testsuite/99626, + testsuite/99636, tree-optimization/98834, tree-optimization/99305, + tree-optimization/99489, tree-optimization/99510, + tree-optimization/99523, tree-optimization/99544 + - fix ARM ICE in neon_output_shift_immediate (#1922599, PR target/99593) +- avoid false positive aarch64 -Wpsabi notes in some cases (PR target/91710) +- fix a -fcompare-debug failure caused by C FE bug (PR debug/99230) +- fix up -gdwarf-5 -gsplit-dwarf ranges handling (PR debug/99490) +- fix up handling of > 64 bit constants in dwarf2out (PR debug/99562, + PR debug/66728) +- reject invalid C++ structured bindings that need reference to void + (PR c++/99650) +- include private isl 0.18 in the package instead of relying on old + distro version + +* Sun Mar 7 2021 Jakub Jelinek 11.0.1-0.1 +- update from trunk + - PRs ada/98996, ada/99020, ada/99095, ada/99264, analyzer/96374, + analyzer/99193, bootstrap/92002, bootstrap/98590, c++/82959, + c++/88146, c++/90333, c++/94521, c++/95451, c++/95615, c++/95616, + c++/95675, c++/95822, c++/96078, c++/96330, c++/96443, c++/96474, + c++/96960, c++/97034, c++/97587, c++/98118, c++/98318, c++/98810, + c++/98990, c++/99009, c++/99103, c++/99120, c++/99166, c++/99170, + c++/99176, c++/99213, c++/99245, c++/99251, c++/99287, c++/99294, + c++/99344, c++/99362, c++/99365, c++/99374, c++/99377, c++/99389, + c/99137, c/99275, c/99304, c/99323, c/99324, c/99325, c/99363, + d/99337, debug/66668, debug/99090, debug/99319, fortran/57871, + fortran/99300, fortran/99303, fortran/99355, gcov-profile/97461, + gcov-profile/99105, gcov-profile/99385, gcov-profile/99406, ipa/98078, + ipa/98338, libbacktrace/98818, libfortran/81986, libfortran/99218, + libgomp/98738, libstdc++/99265, libstdc++/99270, libstdc++/99301, + libstdc++/99382, libstdc++/99396, middle-end/93235, middle-end/94655, + middle-end/95757, middle-end/96963, middle-end/97172, + middle-end/97855, middle-end/99276, middle-end/99281, + middle-end/99295, middle-end/99322, other/99288, + rtl-optimization/99376, target/44107, target/48097, target/95798, + target/98996, target/99085, target/99234, target/99271, target/99279, + target/99313, target/99321, target/99381, testsuite/99233, + tree-optimization/80635, tree-optimization/99253 +- fix debug info for __fp16 constants (PR debug/99388) + * Thu Feb 25 2021 Jakub Jelinek 11.0.0-0.20 - update from trunk - PRs analyzer/94596, analyzer/98969, analyzer/99196, c++/94034, c++/94546, diff --git a/gcc11-isl-dl2.patch b/gcc11-isl-dl2.patch new file mode 100644 index 0000000..ac14ed3 --- /dev/null +++ b/gcc11-isl-dl2.patch @@ -0,0 +1,71 @@ +2011-04-04 Jakub Jelinek + + * toplev.c (toplev_main_argv): New variable. + (toplev_main): Initialize it. + * graphite.c (init_isl_pointers): Load libisl.so.15 from gcc's private + directory. + +--- gcc/toplev.c.jj 2008-12-09 23:59:10.000000000 +0100 ++++ gcc/toplev.c 2009-01-27 14:33:52.000000000 +0100 +@@ -117,6 +117,8 @@ static void compile_file (void); + /* True if we don't need a backend (e.g. preprocessing only). */ + static bool no_backend; + ++const char **toplev_main_argv; ++ + /* Decoded options, and number of such options. */ + struct cl_decoded_option *save_decoded_options; + unsigned int save_decoded_options_count; +@@ -2287,6 +2289,8 @@ toplev::main (int argc, char **argv) + + expandargv (&argc, &argv); + ++ toplev_main_argv = CONST_CAST2 (const char **, char **, argv); ++ + /* Initialization of GCC's environment, and diagnostics. */ + general_init (argv[0], m_init_signals); + +--- gcc/graphite.c.jj 2010-12-01 10:24:32.000000000 -0500 ++++ gcc/graphite.c 2010-12-01 11:46:07.832118193 -0500 +@@ -64,11 +64,39 @@ __typeof (isl_pointers__) isl_pointers__ + static bool + init_isl_pointers (void) + { +- void *h; ++ void *h = NULL; ++ extern const char **toplev_main_argv; ++ char *buf, *p; ++ size_t len; + + if (isl_pointers__.inited) + return isl_pointers__.h != NULL; +- h = dlopen ("libisl.so.15", RTLD_LAZY); ++ len = progname - toplev_main_argv[0]; ++ buf = XALLOCAVAR (char, len + sizeof "libisl.so.15"); ++ memcpy (buf, toplev_main_argv[0], len); ++ strcpy (buf + len, "libisl.so.15"); ++ len += sizeof "libisl.so.15"; ++ p = strstr (buf, "/libexec/"); ++ if (p != NULL) ++ { ++ while (1) ++ { ++ char *q = strstr (p + 8, "/libexec/"); ++ if (q == NULL) ++ break; ++ p = q; ++ } ++ memmove (p + 4, p + 8, len - (p + 8 - buf)); ++ h = dlopen (buf, RTLD_LAZY); ++ if (h == NULL) ++ { ++ len = progname - toplev_main_argv[0]; ++ memcpy (buf, toplev_main_argv[0], len); ++ strcpy (buf + len, "libisl.so.15"); ++ } ++ } ++ if (h == NULL) ++ h = dlopen (buf, RTLD_LAZY); + isl_pointers__.h = h; + if (h == NULL) + return false; diff --git a/gcc11-pr91710.patch b/gcc11-pr91710.patch new file mode 100644 index 0000000..fde604c --- /dev/null +++ b/gcc11-pr91710.patch @@ -0,0 +1,96 @@ +2021-03-18 Jakub Jelinek + + 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; ++} diff --git a/gcc11-pr98338-workaround.patch b/gcc11-pr98338-workaround.patch deleted file mode 100644 index 0c8e248..0000000 --- a/gcc11-pr98338-workaround.patch +++ /dev/null @@ -1,17 +0,0 @@ -2020-12-17 Jakub Jelinek - - PR bootstrap/98338 - * range-op.cc (operator_plus::op2_range): Tail-call op1_range - to work-around ICF profile merging ICE during profiledbootstrap. - ---- gcc/range-op.cc.jj 2020-12-17 16:06:39.789526868 +0100 -+++ gcc/range-op.cc 2020-12-17 16:19:18.127240700 +0100 -@@ -950,7 +950,7 @@ operator_plus::op2_range (irange &r, tre - const irange &lhs, - const irange &op1) const - { -- return range_op_handler (MINUS_EXPR, type)->fold_range (r, type, lhs, op1); -+ return op1_range (r, type, lhs, op1); - } - - diff --git a/gcc11-pr99341-revert.patch b/gcc11-pr99341-revert.patch new file mode 100644 index 0000000..c7419cb --- /dev/null +++ b/gcc11-pr99341-revert.patch @@ -0,0 +1,176 @@ +libstdc++: Remove symbols for new std::call_once implementation [PR 99341] + +This removes the new symbols added for the new futex-based +std::call_once implementation. These symbols were new on trunk, so not +in any released version. However, they are already present in some +beta distro releases (Fedora Linux 34) and in Fedora Linux rawhide. This +change can be locally reverted by distros that need to keep the symbols +present until affected packages have been rebuilt. + +Revert: +2021-03-12 Jonathan Wakely + + PR libstdc++/99341 + * config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Remove + std::once_flag symbols. + * config/abi/post/ia64-linux-gnu/baseline_symbols.txt: Likewise. + * config/abi/post/m68k-linux-gnu/baseline_symbols.txt: Likewise. + * config/abi/post/riscv64-linux-gnu/baseline_symbols.txt: + Likewise. + * config/abi/pre/gnu.ver: Likewise. + * src/c++11/mutex.cc [_GLIBCXX_HAVE_LINUX_FUTEX] + (struct __once_flag_compat): Remove. + (_ZNSt9once_flag11_M_activateEv): Remove. + (_ZNSt9once_flag9_M_finishEb): Remove. + +--- libstdc++-v3/config/abi/post/aarch64-linux-gnu/baseline_symbols.txt ++++ libstdc++-v3/config/abi/post/aarch64-linux-gnu/baseline_symbols.txt +@@ -4086,6 +4086,8 @@ FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC2Em@@GLIBCXX + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED0Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED1Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED2Ev@@GLIBCXX_3.4 ++FUNC:_ZNSt9once_flag11_M_activateEv@@GLIBCXX_3.4.29 ++FUNC:_ZNSt9once_flag9_M_finishEb@@GLIBCXX_3.4.29 + FUNC:_ZNSt9strstream3strEv@@GLIBCXX_3.4 + FUNC:_ZNSt9strstream6freezeEb@@GLIBCXX_3.4 + FUNC:_ZNSt9strstreamC1EPciSt13_Ios_Openmode@@GLIBCXX_3.4 +--- libstdc++-v3/config/abi/post/ia64-linux-gnu/baseline_symbols.txt ++++ libstdc++-v3/config/abi/post/ia64-linux-gnu/baseline_symbols.txt +@@ -4086,6 +4086,8 @@ FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC2Em@@GLIBCXX + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED0Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED1Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED2Ev@@GLIBCXX_3.4 ++FUNC:_ZNSt9once_flag11_M_activateEv@@GLIBCXX_3.4.29 ++FUNC:_ZNSt9once_flag9_M_finishEb@@GLIBCXX_3.4.29 + FUNC:_ZNSt9strstream3strEv@@GLIBCXX_3.4 + FUNC:_ZNSt9strstream6freezeEb@@GLIBCXX_3.4 + FUNC:_ZNSt9strstreamC1EPciSt13_Ios_Openmode@@GLIBCXX_3.4 +--- libstdc++-v3/config/abi/post/m68k-linux-gnu/baseline_symbols.txt ++++ libstdc++-v3/config/abi/post/m68k-linux-gnu/baseline_symbols.txt +@@ -4086,6 +4086,8 @@ FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC2Ej@@GLIBCXX + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED0Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED1Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED2Ev@@GLIBCXX_3.4 ++FUNC:_ZNSt9once_flag11_M_activateEv@@GLIBCXX_3.4.29 ++FUNC:_ZNSt9once_flag9_M_finishEb@@GLIBCXX_3.4.29 + FUNC:_ZNSt9strstream3strEv@@GLIBCXX_3.4 + FUNC:_ZNSt9strstream6freezeEb@@GLIBCXX_3.4 + FUNC:_ZNSt9strstreamC1EPciSt13_Ios_Openmode@@GLIBCXX_3.4 +--- libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt ++++ libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt +@@ -4086,6 +4086,8 @@ FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC2Em@@GLIBCXX + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED0Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED1Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED2Ev@@GLIBCXX_3.4 ++FUNC:_ZNSt9once_flag11_M_activateEv@@GLIBCXX_3.4.29 ++FUNC:_ZNSt9once_flag9_M_finishEb@@GLIBCXX_3.4.29 + FUNC:_ZNSt9strstream3strEv@@GLIBCXX_3.4 + FUNC:_ZNSt9strstream6freezeEb@@GLIBCXX_3.4 + FUNC:_ZNSt9strstreamC1EPciSt13_Ios_Openmode@@GLIBCXX_3.4 +--- libstdc++-v3/config/abi/pre/gnu.ver ++++ libstdc++-v3/config/abi/pre/gnu.ver +@@ -2388,6 +2388,11 @@ GLIBCXX_3.4.29 { + _ZNKRSt7__cxx1118basic_stringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EE3strEv; + _ZNSt7__cxx1118basic_stringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EE3strEONS_12basic_stringI[cw]S2_S3_EE; + ++ # std::once_flag::_M_activate() ++ _ZNSt9once_flag11_M_activateEv; ++ # std::once_flag::_M_finish(bool) ++ _ZNSt9once_flag9_M_finishEb; ++ + # std::to_chars(char*, char*, [float|double|long double]) + _ZSt8to_charsPcS_[def]; + # std::to_chars(char*, char*, [float|double|long double], chars_format) +--- libstdc++-v3/src/c++11/mutex.cc ++++ libstdc++-v3/src/c++11/mutex.cc +@@ -26,6 +26,90 @@ + + #ifdef _GLIBCXX_HAS_GTHREADS + ++#if defined _GLIBCXX_SHARED && ! _GLIBCXX_INLINE_VERSION ++ ++#ifdef _GLIBCXX_HAVE_LINUX_FUTEX ++# include ++# include ++# include ++ ++namespace std _GLIBCXX_VISIBILITY(default) ++{ ++_GLIBCXX_BEGIN_NAMESPACE_VERSION ++ ++struct __once_flag_compat ++{ ++ enum _Bits : int { _Init = 0, _Active = 1, _Done = 2 }; ++ int _M_once = 0; ++ bool _M_activate(); ++ void _M_finish(bool returning) noexcept; ++}; ++ ++bool ++__once_flag_compat::_M_activate() ++{ ++ if (__gnu_cxx::__is_single_threaded()) ++ { ++ if (_M_once == _Bits::_Done) ++ return false; ++ _M_once = _Bits::_Active; ++ return true; ++ } ++ ++ while (true) ++ { ++ int expected = _Bits::_Init; ++ constexpr int active = _Bits::_Active; ++ if (__atomic_compare_exchange_n(&_M_once, &expected, active, false, ++ __ATOMIC_ACQ_REL, ++ __ATOMIC_ACQUIRE)) ++ { ++ // This thread is now doing an active execution. ++ return true; ++ } ++ ++ if (expected == _Bits::_Done) ++ return false; // A returning execution happened, this is passive. ++ ++ // Otherwise, an active execution is happening. Wait for it to finish. ++ constexpr int futex_wait = 128; // FUTEX_WAIT_PRIVATE ++ syscall (SYS_futex, &_M_once, futex_wait, expected, 0); ++ } ++} ++ ++void ++std::__once_flag_compat::_M_finish(bool returning) noexcept ++{ ++ const int newval = returning ? _Bits::_Done : _Bits::_Init; ++ if (__gnu_cxx::__is_single_threaded()) ++ { ++ __glibcxx_assert(_M_once == _Bits::_Active); ++ _M_once = newval; ++ } ++ else ++ { ++ int prev [[maybe_unused]] ++ = __atomic_exchange_n(&_M_once, newval, __ATOMIC_RELEASE); ++ __glibcxx_assert(prev & _Bits::_Active); ++ // Wake any other threads waiting for this execution to finish. ++ constexpr int futex_wake = 129; // FUTEX_WAKE_PRIVATE ++ syscall (SYS_futex, &_M_once, futex_wake, INT_MAX); ++ } ++} ++ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wattribute-alias" ++extern "C" bool _ZNSt9once_flag11_M_activateEv() ++ __attribute__((alias ("_ZNSt18__once_flag_compat11_M_activateEv"))); ++extern "C" void _ZNSt9once_flag9_M_finishEb() noexcept ++ __attribute__((alias ("_ZNSt18__once_flag_compat9_M_finishEb"))); ++#pragma GCC diagnostic pop ++ ++_GLIBCXX_END_NAMESPACE_VERSION ++} // namespace std ++#endif // FUTEX ++#endif // ONCE_FLAG_COMPAT && SHARED && ! INLINE_VERSION ++ + namespace std _GLIBCXX_VISIBILITY(default) + { + _GLIBCXX_BEGIN_NAMESPACE_VERSION diff --git a/gcc11-pr99490.patch b/gcc11-pr99490.patch new file mode 100644 index 0000000..abda126 --- /dev/null +++ b/gcc11-pr99490.patch @@ -0,0 +1,473 @@ +2021-03-12 Jakub Jelinek + + 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; diff --git a/sources b/sources index 5301735..030c3fa 100644 --- a/sources +++ b/sources @@ -1,3 +1,4 @@ -SHA512 (gcc-11.0.0-20210225.tar.xz) = 9aad03aa5dcc198fda4c465021ac4a0d62012aefdd1fdfa1019aaa8fabfe812bd82aa66997ddd219a7388881b5f2d24d9dd8eb754d7dfeae159af0ceeeef851b +SHA512 (gcc-11.0.1-20210324.tar.xz) = 3f7fb2bb2098b021efe5e3dcf128a91525adc49ace1ad4120bbccc95827c45affe9beacfff43b03a0da30fcb6f8ea1a22ab7bd05f2aed05b0541f8c2ca4cfd0c +SHA512 (isl-0.18.tar.bz2) = 85d0b40f4dbf14cb99d17aa07048cdcab2dc3eb527d2fbb1e84c41b2de5f351025370e57448b63b2b8a8cf8a0843a089c3263f9baee1542d5c2e1cb37ed39d94 SHA512 (newlib-cygwin-50e2a63b04bdd018484605fbb954fd1bd5147fa0.tar.xz) = 002a48a7b689a81abbf16161bcaec001a842e67dfbe372e9e109092703bfc666675f16198f60ca429370e8850d564547dc505df81bc3aaca4ce6defbc014ad6c SHA512 (nvptx-tools-5f6f343a302d620b0868edab376c00b15741e39e.tar.xz) = f6d10db94fa1570ae0f94df073fa3c73c8e5ee16d59070b53d94f7db0de8a031bc44d7f3f1852533da04b625ce758e022263855ed43cfc6867e0708d001e53c7 diff --git a/update-gcc.sh b/update-gcc.sh index dc695f2..a0fe80c 100755 --- a/update-gcc.sh +++ b/update-gcc.sh @@ -3,5 +3,5 @@ git clone --depth 1 git://gcc.gnu.org/git/gcc.git gcc-dir.tmp git --git-dir=gcc-dir.tmp/.git fetch --depth 1 origin $1 d=`date --iso | sed 's/-//g'` -git --git-dir=gcc-dir.tmp/.git archive --prefix=gcc-11.0.0-$d/ $1 | xz -9e > gcc-11.0.0-$d.tar.xz +git --git-dir=gcc-dir.tmp/.git archive --prefix=gcc-11.0.1-$d/ $1 | xz -9e > gcc-11.0.1-$d.tar.xz rm -rf gcc-dir.tmp