From c90dacf4d2fd0c964a1c294bca5de010929194e8 Mon Sep 17 00:00:00 2001 From: anolis-bot Date: Thu, 17 Nov 2022 16:58:00 +0800 Subject: [PATCH] update to gcc-toolset-12-gcc-12.1.1-3.2.el8 Signed-off-by: anolis-bot --- download | 3 -- gcc.spec | 73 +++++++++++++++++++++++++++----- gcc12-libtsan-s390x.patch | 17 ++++++++ gcc12-pr105551.patch | 28 ++++++++++++ gcc12-pr105991.patch | 89 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 196 insertions(+), 14 deletions(-) create mode 100644 gcc12-libtsan-s390x.patch create mode 100644 gcc12-pr105551.patch create mode 100644 gcc12-pr105991.patch diff --git a/download b/download index 5e06243..10df8e1 100644 --- a/download +++ b/download @@ -1,8 +1,5 @@ 5ff66c50ca9288d9a3d695a031f6950c doxygen-1.8.0.src.tar.gz -69e8afb0efe379aebf6ce07f70511e25 gcc-12.1.1-20220507.tar.xz 86ee6e54ebfc4a90b643a65e402c4048 gmp-6.1.0.tar.bz2 -11436d6b205e516635b666090b94ab32 isl-0.18.tar.bz2 d6a1d5f8ddea3abd2cc3e98f58352d26 mpc-1.0.3.tar.gz -b8a2f6b0e68bef46e53da2ac439e1cf4 mpfr-3.1.4.tar.bz2 61b239238536c66522b4275121ab1f6f newlib-cygwin-50e2a63b04bdd018484605fbb954fd1bd5147fa0.tar.xz 82986188069b75ed65286459df7c8278 nvptx-tools-5f6f343a302d620b0868edab376c00b15741e39e.tar.xz diff --git a/gcc.spec b/gcc.spec index aa692e3..02091d3 100644 --- a/gcc.spec +++ b/gcc.spec @@ -2,13 +2,13 @@ %{?scl:%global __strip %%{_scl_root}/usr/bin/strip} %{?scl:%global __objdump %%{_scl_root}/usr/bin/objdump} %{?scl:%scl_package gcc} -%global DATE 20220507 -%global gitrev fa107326a13af9a7d7aa0df28fe364db0f6fb171 +%global DATE 20220628 +%global gitrev 874cb9452c56f1c3b3a7b5bfed93a262504b9856 %global gcc_version 12.1.1 %global gcc_major 12 # 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 1 +%global gcc_release 3 %global nvptx_tools_gitrev 5f6f343a302d620b0868edab376c00b15741e39e %global newlib_cygwin_gitrev 50e2a63b04bdd018484605fbb954fd1bd5147fa0 %global mpc_version 1.0.3 @@ -80,12 +80,12 @@ %else %global build_libasan 0 %endif -%ifarch x86_64 ppc64 ppc64le aarch64 +%ifarch x86_64 ppc64 ppc64le aarch64 s390x %global build_libtsan 1 %else %global build_libtsan 0 %endif -%ifarch x86_64 ppc64 ppc64le aarch64 +%ifarch x86_64 ppc64 ppc64le aarch64 s390x %global build_liblsan 1 %else %global build_liblsan 0 @@ -147,7 +147,7 @@ Summary: GCC version 12 Name: %{?scl_prefix}gcc Version: %{gcc_version} -Release: %{gcc_release}.3%{?dist} +Release: %{gcc_release}.2%{?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 @@ -195,7 +195,6 @@ URL: http://gcc.gnu.org # Need binutils which support --generate-missing-build-notes=yes >= 2.31 %if 0%{?scl:1} BuildRequires: %{?scl_prefix}binutils >= 2.31 -# For testing BuildRequires: %{?scl_prefix}gdb >= 7.4.50 %endif # While gcc doesn't include statically linked binaries, during testing @@ -349,11 +348,15 @@ Patch8: gcc12-no-add-needed.patch Patch9: gcc12-Wno-format-security.patch Patch10: gcc12-rh1574936.patch Patch11: gcc12-d-shared-libphobos.patch +Patch12: gcc12-pr105551.patch +Patch13: gcc12-libtsan-s390x.patch +# This has been backported to GCC 12, so eventually we can drop it. +Patch14: gcc12-pr105991.patch Patch100: gcc12-fortran-fdec-duplicates.patch Patch101: gcc12-fortran-flogical-as-integer.patch -Patch105: gcc12-fortran-fdec-override-kind.patch -Patch106: gcc12-fortran-fdec-non-logical-if.patch +Patch102: gcc12-fortran-fdec-override-kind.patch +Patch103: gcc12-fortran-fdec-non-logical-if.patch Patch1000: gcc12-libstdc++-compat.patch Patch1001: gcc12-alt-compat-test.patch @@ -724,12 +727,15 @@ so that there cannot be any synchronization problems. %patch10 -p0 -b .rh1574936~ %endif %patch11 -p0 -b .d-shared-libphobos~ +%patch12 -p0 -b .pr105551~ +%patch13 -p0 -b .libtsan-s390x~ +%patch14 -p1 -b .pr105991~ %if 0%{?rhel} >= 6 %patch100 -p1 -b .fortran-fdec-duplicates~ %patch101 -p1 -b .fortran-flogical-as-integer~ -%patch105 -p1 -b .fortran-fdec-override-kind~ -%patch106 -p1 -b .fortran-fdec-non-logical-if~ +%patch102 -p1 -b .fortran-fdec-override-kind~ +%patch103 -p1 -b .fortran-fdec-non-logical-if~ %endif %ifarch %{arm} @@ -2239,6 +2245,7 @@ fi %{_prefix}/bin/gcc-ar%{!?scl:12} %{_prefix}/bin/gcc-nm%{!?scl:12} %{_prefix}/bin/gcc-ranlib%{!?scl:12} +%{_prefix}/bin/lto-dump%{!?scl:12} %ifarch ppc %{_prefix}/bin/%{_target_platform}-gcc%{!?scl:12} %endif @@ -2263,6 +2270,7 @@ fi %{_mandir}/man1/gcov.1* %{_mandir}/man1/gcov-tool.1* %{_mandir}/man1/gcov-dump.1* +%{_mandir}/man1/lto-dump.1* %{_infodir}/gcc* %{_infodir}/cpp* %endif @@ -2867,6 +2875,13 @@ fi %if 0%{?rhel} < 8 %files -n liblsan %{?scl:%{_root_prefix}}%{!?scl:%{_prefix}}/%{_lib}/liblsan.so.0* +%else +%ifarch s390x +# Except that on s390x we don't have the system liblsan, because we +# only enabled LSan in GCC 12. ??? Ugly duplication. +%files -n liblsan +%{?scl:%{_root_prefix}}%{!?scl:%{_prefix}}/%{_lib}/liblsan.so.0* +%endif %endif %files -n %{?scl_prefix}liblsan-devel @@ -2942,6 +2957,42 @@ fi %endif %changelog +* Fri Jul 8 2022 Marek Polacek 12.1.1-3.2 +- recognize PLUS and XOR forms of rldimi (PR target/105991, #2095789) + +* Fri Jul 8 2022 Marek Polacek 12.1.1-3.1 +- always ship liblsan on s390x (#2104829) + +* Wed Jul 6 2022 Marek Polacek 12.1.1-3 +- update from releases/gcc-12 branch + - PRs c++/49387, c++/102307, c++/102651, c++/104470, c++/105491, c++/105589, + c++/105623, c++/105652, c++/105655, c++/105725, c++/105734, + c++/105756, c++/105761, c++/105779, c++/105795, c++/105852, + c++/105871, c++/105885, c++/105908, c++/105925, c++/105931, + c++/105964, c++/106001, c/105635, d/105544, fortran/105230, + gcov-profile/105535, ipa/100413, ipa/105600, ipa/105639, ipa/105739, + libgomp/105745, libgomp/106045, libstdc++/104731, libstdc++/105284, + libstdc++/105671, libstdc++/105681, middle-end/105537, + middle-end/105604, middle-end/105711, middle-end/105951, + middle-end/105998, middle-end/106030, other/105527, + preprocessor/105732, rtl-optimization/105455, rtl-optimization/105559, + rtl-optimization/105577, sanitizer/105714, sanitizer/105729, + target/101891, target/104871, target/105162, target/105209, + target/105292, target/105472, target/105556, target/105599, + target/105854, target/105879, target/105953, target/105960, + target/105970, target/105981, target/106096, tree-optimization/103116, + tree-optimization/105431, tree-optimization/105458, + tree-optimization/105528, tree-optimization/105562, + tree-optimization/105618, tree-optimization/105726, + tree-optimization/105736, tree-optimization/105786, + tree-optimization/105940 +- enable tsan and lsan on s390x (#2101610) +- fix up libtsan on s390x +- fix nvptx build (PRs bootstrap/105551, target/105938) + +* Tue Jun 28 2022 Marek Polacek 12.1.1-1.4 +- ship lto-dump (#2101835) + * Thu Jun 23 2022 Marek Polacek 12.1.1-1.3 - don't provide g++/fortran (CS-1145) diff --git a/gcc12-libtsan-s390x.patch b/gcc12-libtsan-s390x.patch new file mode 100644 index 0000000..4241d43 --- /dev/null +++ b/gcc12-libtsan-s390x.patch @@ -0,0 +1,17 @@ +commit r12-8527-g7811663964aa7e31c3939b859bbfa2e16919639f +Author: Martin Liska +Date: Wed Jun 29 15:28:07 2022 +0200 + + libsanitizer: cherry-pick 791e0d1bc85d + + 791e0d1bc85d: [compiler-rt] Add NO_EXEC_STACK_DIRECTIVE on s390x + (cherry picked from commit aa87b7541b4c11f59c521154513f844ea6b5c977) + +--- libsanitizer/tsan/tsan_rtl_s390x.S ++++ libsanitizer/tsan/tsan_rtl_s390x.S +@@ -45,3 +45,5 @@ intercept setjmp, _ZN14__interception11real_setjmpE + intercept _setjmp, _ZN14__interception12real__setjmpE + intercept sigsetjmp, _ZN14__interception14real_sigsetjmpE + intercept __sigsetjmp, _ZN14__interception16real___sigsetjmpE ++ ++NO_EXEC_STACK_DIRECTIVE diff --git a/gcc12-pr105551.patch b/gcc12-pr105551.patch new file mode 100644 index 0000000..ce8be26 --- /dev/null +++ b/gcc12-pr105551.patch @@ -0,0 +1,28 @@ +2022-05-11 Richard Biener + + PR bootstrap/105551 + * opts.cc (finish_options): Also disable var-tracking if + !DWARF2_DEBUGGING_INFO. + +--- gcc/opts.cc ++++ gcc/opts.cc +@@ -1334,11 +1334,15 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, + || opts->x_flag_selective_scheduling2)); + + /* We know which debug output will be used so we can set flag_var_tracking +- and flag_var_tracking_uninit if the user has not specified them. Note +- we have not yet initialized debug_hooks so we might uselessly run +- var-tracking on targets without var_location debug hook support. */ ++ and flag_var_tracking_uninit if the user has not specified them. */ + if (opts->x_debug_info_level < DINFO_LEVEL_NORMAL +- || !dwarf_debuginfo_p (opts)) ++ || !dwarf_debuginfo_p (opts) ++ /* We have not yet initialized debug hooks so match that to check ++ whether we're only doing DWARF2_LINENO_DEBUGGING_INFO. */ ++#ifndef DWARF2_DEBUGGING_INFO ++ || true ++#endif ++ ) + { + if ((opts_set->x_flag_var_tracking && opts->x_flag_var_tracking == 1) + || (opts_set->x_flag_var_tracking_uninit diff --git a/gcc12-pr105991.patch b/gcc12-pr105991.patch new file mode 100644 index 0000000..b9e12f4 --- /dev/null +++ b/gcc12-pr105991.patch @@ -0,0 +1,89 @@ +commit 6c175b3d170de2bb02b7bd45b3348eec05d28451 +Author: Roger Sayle +Date: Mon Jul 4 13:58:37 2022 +0100 + + PR target/105991: Recognize PLUS and XOR forms of rldimi in rs6000.md. + + This patch addresses PR target/105991 where a change to prefer representing + shifts and adds at the tree-level as multiplications, causes problems for + the rldimi patterns in the powerpc backend. The issue is that rs6000.md + models this pattern using IOR, and some variants that have the equivalent + PLUS or XOR in the RTL fail to match some *rotl4_insert patterns. + This is fixed in this patch by adding a define_insn_and_split to locally + canonicalize the PLUS and XOR forms to the backend's preferred IOR form. + + Backported from master. + + 2022-07-04 Roger Sayle + Marek Polacek + Segher Boessenkool + Kewen Lin + + gcc/ChangeLog + PR target/105991 + * config/rs6000/rs6000.md (rotl3_insert_3): Check that + exact_log2 doesn't return -1 (or zero). + (plus_xor): New code iterator. + (*rotl3_insert_3_): New define_insn_and_split. + + gcc/testsuite/ChangeLog + PR target/105991 + * gcc.target/powerpc/pr105991.c: New test case. + +diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md +index 64049a6e521..6082ded8c31 100644 +--- a/gcc/config/rs6000/rs6000.md ++++ b/gcc/config/rs6000/rs6000.md +@@ -4178,7 +4178,8 @@ (define_insn "rotl3_insert_3" + (match_operand:GPR 4 "const_int_operand" "n")) + (ashift:GPR (match_operand:GPR 1 "gpc_reg_operand" "r") + (match_operand:SI 2 "const_int_operand" "n"))))] +- "INTVAL (operands[2]) == exact_log2 (UINTVAL (operands[4]) + 1)" ++ "INTVAL (operands[2]) > 0 ++ && INTVAL (operands[2]) == exact_log2 (UINTVAL (operands[4]) + 1)" + { + if (mode == SImode) + return "rlwimi %0,%1,%h2,0,31-%h2"; +@@ -4187,6 +4188,24 @@ (define_insn "rotl3_insert_3" + } + [(set_attr "type" "insert")]) + ++; Canonicalize the PLUS and XOR forms to IOR for rotl3_insert_3 ++(define_code_iterator plus_xor [plus xor]) ++ ++(define_insn_and_split "*rotl3_insert_3_" ++ [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") ++ (plus_xor:GPR ++ (and:GPR (match_operand:GPR 3 "gpc_reg_operand" "0") ++ (match_operand:GPR 4 "const_int_operand" "n")) ++ (ashift:GPR (match_operand:GPR 1 "gpc_reg_operand" "r") ++ (match_operand:SI 2 "const_int_operand" "n"))))] ++ "INTVAL (operands[2]) > 0 ++ && INTVAL (operands[2]) == exact_log2 (UINTVAL (operands[4]) + 1)" ++ "#" ++ "&& 1" ++ [(set (match_dup 0) ++ (ior:GPR (and:GPR (match_dup 3) (match_dup 4)) ++ (ashift:GPR (match_dup 1) (match_dup 2))))]) ++ + (define_code_iterator plus_ior_xor [plus ior xor]) + + (define_split +diff --git a/gcc/testsuite/gcc.target/powerpc/pr105991.c b/gcc/testsuite/gcc.target/powerpc/pr105991.c +new file mode 100644 +index 00000000000..0d9d130cb63 +--- /dev/null ++++ b/gcc/testsuite/gcc.target/powerpc/pr105991.c +@@ -0,0 +1,12 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O2" } */ ++/* { dg-require-effective-target lp64 } */ ++unsigned long long ++foo (unsigned long long value) ++{ ++ value &= 0xffffffff; ++ value |= value << 32; ++ return value; ++} ++/* { dg-final { scan-assembler {\mrldimi\M} } } */ ++ -- Gitee