[gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/
commit: 7605884a68df9554cd36fad5259c4632e07668b8 Author: Sergei Trofimovich gentoo org> AuthorDate: Thu Jul 23 08:50:02 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Thu Jul 23 08:50:02 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=7605884a 10.1.0: mark as abandoned in favour of 10.2.0 Signed-off-by: Sergei Trofimovich gentoo.org> 10.1.0/gentoo/README.history | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/10.1.0/gentoo/README.history b/10.1.0/gentoo/README.history index 6fd902a..537fade 100644 --- a/10.1.0/gentoo/README.history +++ b/10.1.0/gentoo/README.history @@ -1,4 +1,4 @@ -4 TODO +4 Abandoned + 37_all_sparc_pie_TEXTREL.patch + 38_all_ICE-ipa-fnsummary-PR96130.patch
[gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/
commit: 05ffb73edcf527b86b2c651fea4f570524c6e819 Author: Sergei Trofimovich gentoo org> AuthorDate: Sun Jul 19 21:34:30 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Sun Jul 19 21:34:30 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=05ffb73e 10.1.0: backport ipa-fnsummary PR96130 bug Fixes build failure of mesa- Reported-by: Rafael Kitover Bug: https://bugs.gentoo.org/733246 Bug: https://gcc.gnu.org/PR96130 Signed-off-by: Sergei Trofimovich gentoo.org> .../gentoo/38_all_ICE-ipa-fnsummary-PR96130.patch | 104 + 10.1.0/gentoo/README.history | 1 + 2 files changed, 105 insertions(+) diff --git a/10.1.0/gentoo/38_all_ICE-ipa-fnsummary-PR96130.patch b/10.1.0/gentoo/38_all_ICE-ipa-fnsummary-PR96130.patch new file mode 100644 index 000..56ea118 --- /dev/null +++ b/10.1.0/gentoo/38_all_ICE-ipa-fnsummary-PR96130.patch @@ -0,0 +1,104 @@ +https://gcc.gnu.org/PR96130 +https://bugs.gentoo.org/733246 + +From 0d03c0ee5213703ec6d9ffa632fa5298d83adaaa Mon Sep 17 00:00:00 2001 +From: Jakub Jelinek +Date: Mon, 13 Jul 2020 18:25:53 +0200 +Subject: [PATCH] ipa-fnsummary: Fix ICE with switch predicates [PR96130] + +The following testcase ICEs since r10-3199. +There is a switch with default label, where the controlling expression has +range just 0..7 and there are case labels for all those 8 values, but +nothing has yet optimized away the default. +Since r10-3199, set_switch_stmt_execution_predicate sets the switch to +default label's edge's predicate to a false predicate and then +compute_bb_predicates propagates the predicates through the cfg, but false +predicates aren't really added. The caller of compute_bb_predicates +in one place handles NULL bb->aux as false predicate: + if (fbi.info) + { + if (bb->aux) + bb_predicate = *(predicate *) bb->aux; + else + bb_predicate = false; + } + else + bb_predicate = true; +but then in two further spots that the patch below is changing +it assumes bb->aux must be non-NULL. Those two spots are guarded by a +condition that is only true if fbi.info is non-NULL, so I think the right +fix is to treat NULL aux as false predicate in those spots too. + +2020-07-13 Jakub Jelinek + + PR ipa/96130 + * ipa-fnsummary.c (analyze_function_body): Treat NULL bb->aux + as false predicate. + + * gcc.dg/torture/pr96130.c: New test. + +(cherry picked from commit 776e48e0931db69f158f40e5cb8e15463d879a42) +--- + gcc/ipa-fnsummary.c| 10 -- + gcc/testsuite/gcc.dg/torture/pr96130.c | 26 ++ + 2 files changed, 34 insertions(+), 2 deletions(-) + create mode 100644 gcc/testsuite/gcc.dg/torture/pr96130.c + +--- a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c +@@ -2766,7 +2766,10 @@ analyze_function_body (struct cgraph_node *node, bool early) + edge ex; + unsigned int j; + class tree_niter_desc niter_desc; +-bb_predicate = *(predicate *) loop->header->aux; ++if (loop->header->aux) ++ bb_predicate = *(predicate *) loop->header->aux; ++else ++ bb_predicate = false; + + exits = get_loop_exit_edges (loop); + FOR_EACH_VEC_ELT (exits, j, ex) +@@ -2799,7 +2802,10 @@ analyze_function_body (struct cgraph_node *node, bool early) + for (unsigned i = 0; i < loop->num_nodes; i++) + { + gimple_stmt_iterator gsi; +-bb_predicate = *(predicate *) body[i]->aux; ++if (body[i]->aux) ++ bb_predicate = *(predicate *) body[i]->aux; ++else ++ bb_predicate = false; + for (gsi = gsi_start_bb (body[i]); !gsi_end_p (gsi); + gsi_next ()) + { +--- /dev/null b/gcc/testsuite/gcc.dg/torture/pr96130.c +@@ -0,0 +1,26 @@ ++/* PR ipa/96130 */ ++/* { dg-do compile } */ ++ ++struct S { unsigned j : 3; }; ++int k, l, m; ++ ++void ++foo (struct S x) ++{ ++ while (l != 5) ++switch (x.j) ++ { ++ case 1: ++ case 3: ++ case 4: ++ case 6: ++ case 2: ++ case 5: ++ l = m; ++ case 7: ++ case 0: ++ k = 0; ++ default: ++ break; ++ } ++} +-- +2.27.0 + diff --git a/10.1.0/gentoo/README.history b/10.1.0/gentoo/README.history index f081231..6fd902a 100644 --- a/10.1.0/gentoo/README.history +++ b/10.1.0/gentoo/README.history @@ -1,5 +1,6 @@ 4 TODO + 37_all_sparc_pie_TEXTREL.patch + + 38_all_ICE-ipa-fnsummary-PR96130.patch 3 04 July 2020 + 33_all_avx512-scalar-PR95528.patch
[gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/
commit: 6c5ced06c025ddc8b34d02c7597d0f0f0932393f Author: Sergei Trofimovich gentoo org> AuthorDate: Tue Jul 14 07:12:22 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Tue Jul 14 07:12:22 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=6c5ced06 10.1.0: use crtendS.o on sparc-linux-pie This should fix TEXTREL warning when linking most binaries on sparc. Bug: https://gcc.gnu.org/PR96190 Bug: https://bugs.gentoo.org/619706 Signed-off-by: Sergei Trofimovich gentoo.org> 10.1.0/gentoo/37_all_sparc_pie_TEXTREL.patch | 49 10.1.0/gentoo/README.history | 3 ++ 2 files changed, 52 insertions(+) diff --git a/10.1.0/gentoo/37_all_sparc_pie_TEXTREL.patch b/10.1.0/gentoo/37_all_sparc_pie_TEXTREL.patch new file mode 100644 index 000..059f744 --- /dev/null +++ b/10.1.0/gentoo/37_all_sparc_pie_TEXTREL.patch @@ -0,0 +1,49 @@ +https://gcc.gnu.org/PR96190 +https://bugs.gentoo.org/619706 + +From 6acaa3c1c1e6202af9871aa304ed772939d51311 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Tue, 14 Jul 2020 07:48:42 +0100 +Subject: [PATCH] sparc/sparc64: use PIE_SPEC to select crtendS.o [PR96190] + +In --enable-default-pie mode compiler should switch from +using crtend.o to crtendS.o. On sparc it is especially visible +because crtend.o contains PIC-unfriendly code. + +gcc: + +2020-07-14 Sergei Trofimovich + + PR driver/96190 + * config/sparc/linux.h: Use PIE_SPEC to select crtendS.o. + * config/sparc/linux64.h: ditto +--- + gcc/config/sparc/linux.h | 2 +- + gcc/config/sparc/linux64.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h +@@ -35,7 +35,7 @@ along with GCC; see the file COPYING3. If not see + + #undef ENDFILE_SPEC + #define ENDFILE_SPEC \ +- "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s\ ++ "%{shared|" PIE_SPEC ":crtendS.o%s;:crtend.o%s} crtn.o%s\ +%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" + + /* -mcpu=native handling only makes sense with compiler running on +--- a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h +@@ -52,7 +52,7 @@ along with GCC; see the file COPYING3. If not see + + #undefENDFILE_SPEC + #define ENDFILE_SPEC \ +- "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s\ ++ "%{shared|" PIE_SPEC ":crtendS.o%s;:crtend.o%s} crtn.o%s\ +%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" + + /* The default code model. */ +-- +2.27.0 + diff --git a/10.1.0/gentoo/README.history b/10.1.0/gentoo/README.history index 6fab577..f081231 100644 --- a/10.1.0/gentoo/README.history +++ b/10.1.0/gentoo/README.history @@ -1,3 +1,6 @@ +4 TODO + + 37_all_sparc_pie_TEXTREL.patch + 3 04 July 2020 + 33_all_avx512-scalar-PR95528.patch + 34_all_cet-cross-x86.patch
[gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/
commit: ad32bf914e7dda8709a7adb8197bc43917be4f41 Author: Sergei Trofimovich gentoo org> AuthorDate: Sat Jul 4 07:44:32 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Sat Jul 4 07:44:32 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=ad32bf91 10.1.0: cut 3 patchset Four new patches: + 33_all_avx512-scalar-PR95528.patch: fix ICE on small avx512 unpack + 34_all_cet-cross-x86.patch: backport CET cross-compilation fix + 35_all_ICE-array-subscript-PR95508.patch: fix ICE on some C++ array subscripts + 36_all_fno-delayed-branch.patch: disable -fdelayed-branch to to fix python mis-compilation. Bug: https://gcc.gnu.org/PR95528 Bug: https://bugs.gentoo.org/727028 Bug: https://gcc.gnu.org/94998 Bug: https://bugs.gentoo.org/729074 Bug: https://gcc.gnu.org/PR95508 Bug: https://bugs.gentoo.org/729434 Reported-by: Jeroen Roovers Bug: https://gcc.gnu.org/PR96015 Bug: https://bugs.gentoo.org/729570. Signed-off-by: Sergei Trofimovich gentoo.org> 10.1.0/gentoo/README.history | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/10.1.0/gentoo/README.history b/10.1.0/gentoo/README.history index 6b6324c..55c9ed6 100644 --- a/10.1.0/gentoo/README.history +++ b/10.1.0/gentoo/README.history @@ -1,4 +1,4 @@ -3 TODO +3 04 July 2020 33_all_avx512-scalar-PR95528.patch 34_all_cet-cross-x86.patch 35_all_ICE-array-subscript-PR95508.patch
[gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/
commit: be69d1eacee060752729a4ae701d49ce98265371 Author: Sergei Trofimovich gentoo org> AuthorDate: Sat Jul 4 07:49:17 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Sat Jul 4 07:49:17 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=be69d1ea 10.1.0: tweak README.history syntax for added patches Signed-off-by: Sergei Trofimovich gentoo.org> 10.1.0/gentoo/36_all_fno-delayed-branch.patch | 2 +- 10.1.0/gentoo/README.history | 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/10.1.0/gentoo/36_all_fno-delayed-branch.patch b/10.1.0/gentoo/36_all_fno-delayed-branch.patch index bc19974..33ff2f4 100644 --- a/10.1.0/gentoo/36_all_fno-delayed-branch.patch +++ b/10.1.0/gentoo/36_all_fno-delayed-branch.patch @@ -10,7 +10,7 @@ __builtin_unreachable(); and mis-compiles python. Use blunt hammer and disable delayed slots until we have better fix. Reported-by: Jeroen Roovers -Bug: From https://gcc.gnu.org/PR96015 +Bug: https://gcc.gnu.org/PR96015 Bug: https://bugs.gentoo.org/729570. Signed-off-by: Sergei Trofimovich --- diff --git a/10.1.0/gentoo/README.history b/10.1.0/gentoo/README.history index 55c9ed6..6fab577 100644 --- a/10.1.0/gentoo/README.history +++ b/10.1.0/gentoo/README.history @@ -1,8 +1,8 @@ 3 04 July 2020 - 33_all_avx512-scalar-PR95528.patch - 34_all_cet-cross-x86.patch - 35_all_ICE-array-subscript-PR95508.patch - 36_all_fno-delayed-branch.patch + + 33_all_avx512-scalar-PR95528.patch + + 34_all_cet-cross-x86.patch + + 35_all_ICE-array-subscript-PR95508.patch + + 36_all_fno-delayed-branch.patch 2 11 June 2020 + 29_all_fix-float-hang-PR95118.patch
[gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/
commit: 6e1df9589fa94fb616529fbd7908b8f3076f1f19 Author: Sergei Trofimovich gentoo org> AuthorDate: Fri Jul 3 22:12:10 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Fri Jul 3 22:12:10 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=6e1df958 10.1.0: Disable -fdelayed-branch by default. >From https://gcc.gnu.org/PR96015 / https://bugs.gentoo.org/729570. delayed branches are known to generate invalid code around __builtin_unreachable(); and mis-compiles python. Use blunt hammer and disable delayed slots until we have better fix. Reported-by: Jeroen Roovers Bug: From https://gcc.gnu.org/PR96015 Bug: https://bugs.gentoo.org/729570. Signed-off-by: Sergei Trofimovich gentoo.org> 10.1.0/gentoo/36_all_fno-delayed-branch.patch | 40 +++ 10.1.0/gentoo/README.history | 1 + 2 files changed, 41 insertions(+) diff --git a/10.1.0/gentoo/36_all_fno-delayed-branch.patch b/10.1.0/gentoo/36_all_fno-delayed-branch.patch new file mode 100644 index 000..bc19974 --- /dev/null +++ b/10.1.0/gentoo/36_all_fno-delayed-branch.patch @@ -0,0 +1,40 @@ +From 6d0d3ae914bf19706550a539ef304c5875535ffc Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Fri, 3 Jul 2020 22:50:33 +0100 +Subject: [PATCH] Disable -fdelayed-branch by default. + +From https://gcc.gnu.org/PR96015 / https://bugs.gentoo.org/729570. +delayed branches are known to generate invalid code around +__builtin_unreachable(); and mis-compiles python. + +Use blunt hammer and disable delayed slots until we have better fix. + +Reported-by: Jeroen Roovers +Bug: From https://gcc.gnu.org/PR96015 +Bug: https://bugs.gentoo.org/729570. +Signed-off-by: Sergei Trofimovich +--- + gcc/opts.c | 9 - + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/gcc/opts.c b/gcc/opts.c +@@ -458,7 +458,14 @@ static const struct default_options default_options_table[] = + /* -O1 (and not -Og) optimizations. */ + { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fbranch_count_reg, NULL, 1 }, + #if DELAY_SLOTS +-{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fdelayed_branch, NULL, 1 }, ++/* ++ * From https://gcc.gnu.org/PR96015 / https://bugs.gentoo.org/729570. ++ * delayed branches are known to generate invalid code around ++ * __builtin_unreachable(); and mis-compiles python. ++ * ++ * Use blunt hammer and disable delayed slots until we have better fix. ++ */ ++/* { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fdelayed_branch, NULL, 1 }, */ + #endif + { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fdse, NULL, 1 }, + { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fif_conversion, NULL, 1 }, +-- +2.27.0 + diff --git a/10.1.0/gentoo/README.history b/10.1.0/gentoo/README.history index 72e0086..6b6324c 100644 --- a/10.1.0/gentoo/README.history +++ b/10.1.0/gentoo/README.history @@ -2,6 +2,7 @@ 33_all_avx512-scalar-PR95528.patch 34_all_cet-cross-x86.patch 35_all_ICE-array-subscript-PR95508.patch + 36_all_fno-delayed-branch.patch 2 11 June 2020 + 29_all_fix-float-hang-PR95118.patch
[gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/
commit: 21ed34524e3ab3139c811b6d61f50522ebd2b184 Author: Sergei Trofimovich gentoo org> AuthorDate: Wed Jun 24 20:14:42 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Wed Jun 24 20:14:42 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=21ed3452 10.1.0: backport PR95508, ICE on array subscript implicit conversion Reported-by: hsk17 mail.de Bug: https://bugs.gentoo.org/729434 Signed-off-by: Sergei Trofimovich gentoo.org> .../35_all_ICE-array-subscript-PR95508.patch | 106 + 10.1.0/gentoo/README.history | 1 + 2 files changed, 107 insertions(+) diff --git a/10.1.0/gentoo/35_all_ICE-array-subscript-PR95508.patch b/10.1.0/gentoo/35_all_ICE-array-subscript-PR95508.patch new file mode 100644 index 000..37abd53 --- /dev/null +++ b/10.1.0/gentoo/35_all_ICE-array-subscript-PR95508.patch @@ -0,0 +1,106 @@ +https://gcc.gnu.org/PR95508 +https://bugs.gentoo.org/729434 + +From 1bab254fd30c2b94a675b9057349fc80946375b1 Mon Sep 17 00:00:00 2001 +From: Marek Polacek +Date: Wed, 17 Jun 2020 14:38:05 -0400 +Subject: [PATCH] c++: ICE with IMPLICIT_CONV_EXPR in array subscript [PR95508] + +Since r10-7096 convert_like, when called in a template, creates an +IMPLICIT_CONV_EXPR when we're converting to/from array type. + +In this test, we have e[f], and we're converting f (of type class A) to +int, so convert_like in build_new_op_1 created the IMPLICIT_CONV_EXPR +that got into cp_build_array_ref which calls maybe_constant_value. My +patch above failed to adjust this spot to call fold_non_dependent_expr +instead, which can handle codes like I_C_E in a template. Fixed by +using a new function maybe_fold_non_dependent_expr, which, if the expr +can't be evaluated to a constant, returns the original expression. + +gcc/cp/ChangeLog: + + PR c++/95508 + * constexpr.c (maybe_fold_non_dependent_expr): New. + * cp-tree.h (maybe_fold_non_dependent_expr): Declare. + * typeck.c (cp_build_array_ref): Call maybe_fold_non_dependent_expr + instead of maybe_constant_value. + +gcc/testsuite/ChangeLog: + + PR c++/95508 + * g++.dg/template/conv16.C: New test. +--- + gcc/cp/constexpr.c | 13 + + gcc/cp/cp-tree.h | 2 ++ + gcc/cp/typeck.c| 2 +- + gcc/testsuite/g++.dg/template/conv16.C | 17 + + 4 files changed, 33 insertions(+), 1 deletion(-) + create mode 100644 gcc/testsuite/g++.dg/template/conv16.C + +--- a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c +@@ -7043,6 +7043,19 @@ fold_non_dependent_expr (tree t, + return maybe_constant_value (t, object, manifestly_const_eval); + } + ++/* Like fold_non_dependent_expr, but if EXPR couldn't be folded to a constant, ++ return the original expression. */ ++ ++tree ++maybe_fold_non_dependent_expr (tree expr, ++ tsubst_flags_t complain/*=tf_warning_or_error*/) ++{ ++ tree t = fold_non_dependent_expr (expr, complain); ++ if (t && TREE_CONSTANT (t)) ++return t; ++ ++ return expr; ++} + + /* Like maybe_constant_init but first fully instantiate the argument. */ + +--- a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h +@@ -7955,6 +7955,8 @@ extern tree maybe_constant_init (tree, tree = NULL_TREE, bool = false); + extern tree fold_non_dependent_expr (tree, +tsubst_flags_t = tf_warning_or_error, +bool = false, tree = NULL_TREE); ++extern tree maybe_fold_non_dependent_expr (tree, ++ tsubst_flags_t = tf_warning_or_error); + extern tree fold_non_dependent_init (tree, +tsubst_flags_t = tf_warning_or_error, +bool = false); +--- a/gcc/cp/typeck.c b/gcc/cp/typeck.c +@@ -3553,7 +3553,7 @@ cp_build_array_ref (location_t loc, tree array, tree idx, +pointer arithmetic.) */ + idx = cp_perform_integral_promotions (idx, complain); + +- idx = maybe_constant_value (idx); ++ idx = maybe_fold_non_dependent_expr (idx, complain); + + /* An array that is indexed by a non-constant +cannot be stored in a register; we must be able to do +--- /dev/null b/gcc/testsuite/g++.dg/template/conv16.C +@@ -0,0 +1,17 @@ ++// PR c++/95508 ++// { dg-do compile } ++ ++template ++struct A; ++template ++struct B { ++ operator int () { return 0; } ++}; ++template <> ++struct A : B {}; ++struct D { ++ template ++ int foo () { return e[f]; } ++ int e[6]; ++ A f; ++}; +-- +2.27.0 + diff --git a/10.1.0/gentoo/README.history b/10.1.0/gentoo/README.history index 480a54e..72e0086 100644 --- a/10.1.0/gentoo/README.history +++ b/10.1.0/gentoo/README.history @@ -1,6 +1,7 @@ 3 TODO 33_all_avx512-scalar-PR95528.patch
[gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/
commit: a0cceb035aac865eec1676a80ce04812cb83d4a2 Author: Sergei Trofimovich gentoo org> AuthorDate: Tue Jun 23 06:33:30 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Tue Jun 23 06:33:30 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=a0cceb03 10.1.0: backport CET cross-compiler detection, PR95811 Reported-by: Aisha Tammy Bug: https://bugs.gentoo.org/729074 Bug: https://gcc.gnu.org/94998 Signed-off-by: Sergei Trofimovich gentoo.org> 10.1.0/gentoo/34_all_cet-cross-x86.patch | 149 +++ 10.1.0/gentoo/README.history | 1 + 2 files changed, 150 insertions(+) diff --git a/10.1.0/gentoo/34_all_cet-cross-x86.patch b/10.1.0/gentoo/34_all_cet-cross-x86.patch new file mode 100644 index 000..89916d9 --- /dev/null +++ b/10.1.0/gentoo/34_all_cet-cross-x86.patch @@ -0,0 +1,149 @@ +https://gcc.gnu.org/94998 +https://bugs.gentoo.org/729074 + +From 2c7ae01349f779f1d4e66d8831052ee59f9c948b Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Tue, 12 May 2020 10:39:42 -0700 +Subject: [PATCH] Enable CET in cross compiler if possible + +Don't perform CET run-time check for host when cross compiling. Instead, +enable CET in cross compiler if possible so that it will run on both CET +and non-CET hosts. + +config/ + + PR bootstrap/94998 + * cet.m4 (GCC_CET_HOST_FLAGS): Enable CET in cross compiler if + possible. + +libiberty/ + + PR bootstrap/94998 + * configure: Regenerated. + +lto-plugin/ + + PR bootstrap/94998 + * configure: Regenerated. + +(cherry picked from commit d17cdc17c90ce77cb90c569322c1f241d3530cec) +--- + config/cet.m4| 18 -- + libiberty/configure | 12 +--- + lto-plugin/configure | 16 +++- + 3 files changed, 32 insertions(+), 14 deletions(-) + +--- a/config/cet.m4 b/config/cet.m4 +@@ -111,7 +111,8 @@ if test x$may_have_cet = xyes; then + fi + + if test x$may_have_cet = xyes; then +- AC_TRY_RUN([ ++ if test x$cross_compiling = xno; then ++AC_TRY_RUN([ + static void + foo (void) + { +@@ -137,12 +138,17 @@ main () + bar (); + return 0; + } +- ], +- [have_cet=no], +- [have_cet=yes]) +- if test x$enable_cet = xno -a x$have_cet = xyes; then +-AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host]) ++], ++[have_cet=no], ++[have_cet=yes]) ++if test x$enable_cet = xno -a x$have_cet = xyes; then ++ AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host]) ++fi + fi ++else ++ # Enable CET in cross compiler if possible so that it will run on both ++ # CET and non-CET hosts. ++ have_cet=yes + fi + if test x$enable_cet = xyes; then + $1="-fcf-protection" +--- a/libiberty/configure b/libiberty/configure +@@ -5375,7 +5375,8 @@ rm -f core conftest.err conftest.$ac_objext \ + fi + + if test x$may_have_cet = xyes; then +- if test "$cross_compiling" = yes; then : ++ if test x$cross_compiling = xno; then ++if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error $? "cannot run test program while cross compiling +@@ -5420,9 +5421,14 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + +- if test x$enable_cet = xno -a x$have_cet = xyes; then +-as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5 ++if test x$enable_cet = xno -a x$have_cet = xyes; then ++ as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5 ++fi + fi ++else ++ # Enable CET in cross compiler if possible so that it will run on both ++ # CET and non-CET hosts. ++ have_cet=yes + fi + if test x$enable_cet = xyes; then + CET_HOST_FLAGS="-fcf-protection" +--- a/lto-plugin/configure b/lto-plugin/configure +@@ -5768,7 +5768,8 @@ rm -f core conftest.err conftest.$ac_objext \ + fi + + if test x$may_have_cet = xyes; then +- if test "$cross_compiling" = yes; then : ++ if test x$cross_compiling = xno; then ++if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error $? "cannot run test program while cross compiling +@@ -5813,9 +5814,14 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + +- if test x$enable_cet = xno -a x$have_cet = xyes; then +-as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5 ++if test x$enable_cet = xno -a x$have_cet = xyes; then ++ as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5 ++fi + fi ++else ++ # Enable CET in cross compiler if possible so that it will run on both ++ # CET and non-CET hosts. ++
[gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/
commit: 7b2124fa47d6c44c0605926689310edbcaba2be1 Author: Sergei Trofimovich gentoo org> AuthorDate: Sun Jun 14 11:05:52 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Sun Jun 14 11:05:52 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=7b2124fa 10.1.0: backport avx512 fix for PR95528 Should make firefox-77 compile again on avx512 targets. Reported-by: Thomas Deutschmann Bug: https://bugs.gentoo.org/727028 Bug: https://gcc.gnu.org/PR95528 Signed-off-by: Sergei Trofimovich gentoo.org> 10.1.0/gentoo/33_all_avx512-scalar-PR95528.patch | 92 10.1.0/gentoo/README.history | 3 + 2 files changed, 95 insertions(+) diff --git a/10.1.0/gentoo/33_all_avx512-scalar-PR95528.patch b/10.1.0/gentoo/33_all_avx512-scalar-PR95528.patch new file mode 100644 index 000..4a1a83c --- /dev/null +++ b/10.1.0/gentoo/33_all_avx512-scalar-PR95528.patch @@ -0,0 +1,92 @@ +https://gcc.gnu.org/PR95528 +https://bugs.gentoo.org/727028 + +From c75a2abc3a976096b89475f062d4795247aa02b8 Mon Sep 17 00:00:00 2001 +From: Jakub Jelinek +Date: Mon, 8 Jun 2020 11:05:10 +0200 +Subject: [PATCH] forwprop: Ignore scalar mode vectors in + simplify_vector_constructor [PR95528] + +As mentioned in the PR, the problem is that at least the x86 backend asumes +that the vec_unpack* and vec_pack* optabs with integral modes are for the +AVX512-ish vector masks rather than for very small vectors done in GPRs. +The only other target that seems to have a scalar mode vec_{,un}pack* optab +is aarch64 as discussed in the PR, so there is also a condition for that. +All other targets have just vector mode optabs. + +2020-06-08 Jakub Jelinek + + PR target/95528 + * tree-ssa-forwprop.c (simplify_vector_constructor): Don't use + VEC_UNPACK*_EXPR or VEC_PACK_TRUNC_EXPR with scalar modes unless the + type is vector boolean. + + * g++.dg/opt/pr95528.C: New test. + +(cherry picked from commit 8be374e02761c9d63d2753d71e4bd4874a1577b1) +--- + gcc/testsuite/g++.dg/opt/pr95528.C | 27 +++ + gcc/tree-ssa-forwprop.c| 11 +++ + 2 files changed, 38 insertions(+) + create mode 100644 gcc/testsuite/g++.dg/opt/pr95528.C + +--- /dev/null b/gcc/testsuite/g++.dg/opt/pr95528.C +@@ -0,0 +1,27 @@ ++// PR target/95528 ++// { dg-do compile { target c++11 } } ++// { dg-options "-O3" } ++// { dg-additional-options "-march=skylake-avx512" { target i?86-*-*- x86_64-*-* } } ++ ++template struct b { ++ typedef a c __attribute__((vector_size(sizeof(a) * 4))); ++ union { ++c d; ++struct { ++ a e, f, g, h; ++}; ++ }; ++ b(); ++ b(const b ) : d(i.d) {} ++ static b j(c); ++ template operator b() { ++b::j(typename b::c{k(e), k(f), k(g), k(h)}); ++return b(); ++ } ++}; ++template using l = b; ++using m = l; ++using n = l; ++m o(n i) { return i; } ++b q; ++void p() { o(q); } +--- a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c +@@ -2401,6 +2401,10 @@ simplify_vector_constructor (gimple_stmt_iterator *gsi) + && (dblvectype + = build_vector_type (TREE_TYPE (TREE_TYPE (orig[0])), + nelts * 2)) ++/* Only use it for vector modes or for vector booleans represented ++ as scalar bitmasks. See PR95528. */ ++&& (VECTOR_MODE_P (TYPE_MODE (dblvectype)) ++|| VECTOR_BOOLEAN_TYPE_P (dblvectype)) + && (optab = optab_for_tree_code (FLOAT_TYPE_P (TREE_TYPE (type)) + ? VEC_UNPACK_FLOAT_LO_EXPR + : VEC_UNPACK_LO_EXPR, +@@ -2442,6 +2446,13 @@ simplify_vector_constructor (gimple_stmt_iterator *gsi) + && (halfvectype += build_vector_type (TREE_TYPE (TREE_TYPE (orig[0])), + nelts / 2)) ++ /* Only use it for vector modes or for vector booleans ++represented as scalar bitmasks, or allow halfvectype ++be the element mode. See PR95528. */ ++ && (VECTOR_MODE_P (TYPE_MODE (halfvectype)) ++ || VECTOR_BOOLEAN_TYPE_P (halfvectype) ++ || (TYPE_MODE (halfvectype) ++ == TYPE_MODE (TREE_TYPE (halfvectype + && (optab = optab_for_tree_code (VEC_PACK_TRUNC_EXPR, + halfvectype, + optab_default)) +-- +2.27.0 + diff --git a/10.1.0/gentoo/README.history b/10.1.0/gentoo/README.history index 362382e..a69b102 100644 --- a/10.1.0/gentoo/README.history +++ b/10.1.0/gentoo/README.history @@ -1,3 +1,6 @@ +3 TODO + 33_all_avx512-scalar-PR95528.patch + 2 11 June 2020 + 29_all_fix-float-hang-PR95118.patch +
[gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/
commit: 3c29cc8edec29f4cc48ffc77004cfd9d06b220c7 Author: Sergei Trofimovich gentoo org> AuthorDate: Thu Jun 11 22:52:51 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Thu Jun 11 22:52:51 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=3c29cc8e 10.1.0: cut 2 patchset Four new patches: + 29_all_fix-float-hang-PR95118.patch: fix looping in printing real numbers + 30_all_lto-intl-workaround-PR95194.patch: add a workaround to fix gettext LTO + 31_all_ctor-range-PR95241.patch: fix constexpr constructors with ranges + 32_all_plugin-objdump.patch: user tuple-prefixed objdump Bug: https://gcc.gnu.org/PR95118 Bug: https://bugs.gentoo.org/722774 Reported-by: Andrew Savchenko Bug: https://gcc.gnu.org/PR95194 Bug: https://bugs.gentoo.org/723370 Bug: https://gcc.gnu.org/PR95241 Bug: https://bugs.gentoo.org/726644 Bug: https://gcc.gnu.org/PR95648 Signed-off-by: Sergei Trofimovich gentoo.org> 10.1.0/gentoo/README.history | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/10.1.0/gentoo/README.history b/10.1.0/gentoo/README.history index 33708f4..362382e 100644 --- a/10.1.0/gentoo/README.history +++ b/10.1.0/gentoo/README.history @@ -1,4 +1,4 @@ -2 TODO +2 11 June 2020 + 29_all_fix-float-hang-PR95118.patch + 30_all_lto-intl-workaround-PR95194.patch + 31_all_ctor-range-PR95241.patch
[gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/
commit: b57fca30d3fec404122a7bcf3e0dc1ec64bf2d6f Author: Sergei Trofimovich gentoo org> AuthorDate: Thu Jun 11 22:48:36 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Thu Jun 11 22:48:36 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b57fca30 10.1.0: fix tool-prefixed objdump autodetection Signed-off-by: Sergei Trofimovich gentoo.org> 10.1.0/gentoo/32_all_plugin-objdump.patch | 34 +++ 10.1.0/gentoo/README.history | 1 + 2 files changed, 35 insertions(+) diff --git a/10.1.0/gentoo/32_all_plugin-objdump.patch b/10.1.0/gentoo/32_all_plugin-objdump.patch new file mode 100644 index 000..a9c33fd --- /dev/null +++ b/10.1.0/gentoo/32_all_plugin-objdump.patch @@ -0,0 +1,34 @@ +https://gcc.gnu.org/PR95648 +--- a/config/gcc-plugin.m4 b/config/gcc-plugin.m4 +@@ -45,7 +45,7 @@ AC_DEFUN([GCC_ENABLE_PLUGINS], + ;; + *) +if test x$build = x$host; then +- export_sym_check="objdump${exeext} -T" ++ export_sym_check="$ac_cv_prog_OBJDUMP -T" +elif test x$host = x$target; then +export_sym_check="$gcc_cv_objdump -T" +else +--- a/gcc/configure b/gcc/configure +@@ -30386,7 +30386,7 @@ fi + ;; + *) +if test x$build = x$host; then +- export_sym_check="objdump${exeext} -T" ++ export_sym_check="$ac_cv_prog_OBJDUMP -T" +elif test x$host = x$target; then +export_sym_check="$gcc_cv_objdump -T" +else +--- a/libcc1/configure b/libcc1/configure +@@ -14819,7 +14819,7 @@ fi + ;; + *) +if test x$build = x$host; then +- export_sym_check="objdump${exeext} -T" ++ export_sym_check="$ac_cv_prog_OBJDUMP -T" +elif test x$host = x$target; then +export_sym_check="$gcc_cv_objdump -T" +else diff --git a/10.1.0/gentoo/README.history b/10.1.0/gentoo/README.history index deee08f..33708f4 100644 --- a/10.1.0/gentoo/README.history +++ b/10.1.0/gentoo/README.history @@ -2,6 +2,7 @@ + 29_all_fix-float-hang-PR95118.patch + 30_all_lto-intl-workaround-PR95194.patch + 31_all_ctor-range-PR95241.patch + + 32_all_plugin-objdump.patch 1 05 May 2020 + 01_all_default-fortify-source.patch
[gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/
commit: a78ebddd40831f2c95a594a15c59ab7c3c485e83 Author: Sergei Trofimovich gentoo org> AuthorDate: Fri Jun 5 21:01:11 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Fri Jun 5 21:01:11 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=a78ebddd 10.1.0: fix ICE on constructor range handling Bug: https://gcc.gnu.org/PR95241 Bug: https://bugs.gentoo.org/726644 Signed-off-by: Sergei Trofimovich gentoo.org> 10.1.0/gentoo/31_all_ctor-range-PR95241.patch | 98 +++ 10.1.0/gentoo/README.history | 1 + 2 files changed, 99 insertions(+) diff --git a/10.1.0/gentoo/31_all_ctor-range-PR95241.patch b/10.1.0/gentoo/31_all_ctor-range-PR95241.patch new file mode 100644 index 000..2bd166d --- /dev/null +++ b/10.1.0/gentoo/31_all_ctor-range-PR95241.patch @@ -0,0 +1,98 @@ +https://gcc.gnu.org/PR95241 +https://bugs.gentoo.org/726644 + +From 798a9da416bbfd8996da9a5d53955b082d5b94fe Mon Sep 17 00:00:00 2001 +From: Patrick Palka +Date: Fri, 29 May 2020 09:44:09 -0400 +Subject: [PATCH] c++: constexpr ctor with RANGE_EXPR index [PR95241] + +In the testcase below, the CONSTRUCTOR for 'field' contains a RANGE_EXPR +index: + + {{aggr_init_expr<...>, [1...2]={.off=1}}} + +but get_or_insert_ctor_field isn't prepared to handle looking up a +RANGE_EXPR index. + +This patch adds limited support to get_or_insert_ctor_field for looking +up a RANGE_EXPR index. The limited scope of this patch should make it +more suitable for backporting, and more extensive support would be +needed only to handle self-modifying CONSTRUCTORs that contain a +RANGE_EXPR index, but I haven't yet been able to come up with a testcase +that actually creates such a CONSTRUCTOR. + +gcc/cp/ChangeLog: + + PR c++/95241 + * constexpr.c (get_or_insert_ctor_field): Add limited support + for RANGE_EXPR index lookups. + +gcc/testsuite/ChangeLog: + + PR c++/95241 + * g++.dg/cpp0x/constexpr-array25.C: New test. + +(cherry picked from commit e069285cdf457cc85070e522380c4e25b0d2ed25) +--- + gcc/cp/constexpr.c| 16 ++ + .../g++.dg/cpp0x/constexpr-array25.C | 21 +++ + 2 files changed, 37 insertions(+) + create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-array25.C + +diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c +index 706d8a13d8e..3bd2524648d 100644 +--- a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c +@@ -3245,6 +3245,22 @@ get_or_insert_ctor_field (tree ctor, tree index, int pos_hint = -1) + } + else if (TREE_CODE (type) == ARRAY_TYPE || TREE_CODE (type) == VECTOR_TYPE) + { ++ if (TREE_CODE (index) == RANGE_EXPR) ++ { ++/* Support for RANGE_EXPR index lookups is currently limited to ++ accessing an existing element via POS_HINT, or appending a new ++ element to the end of CTOR. ??? Support for other access ++ patterns may also be needed. */ ++vec *elts = CONSTRUCTOR_ELTS (ctor); ++if (vec_safe_length (elts)) ++ { ++tree lo = TREE_OPERAND (index, 0); ++gcc_assert (array_index_cmp (elts->last().index, lo) < 0); ++ } ++CONSTRUCTOR_APPEND_ELT (elts, index, NULL_TREE); ++return >last(); ++ } ++ + HOST_WIDE_INT i = find_array_ctor_elt (ctor, index, /*insert*/true); + gcc_assert (i >= 0); + constructor_elt *cep = CONSTRUCTOR_ELT (ctor, i); +diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-array25.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-array25.C +new file mode 100644 +index 000..9162943249f +--- /dev/null b/gcc/testsuite/g++.dg/cpp0x/constexpr-array25.C +@@ -0,0 +1,21 @@ ++// PR c++/95241 ++// { dg-do compile { target c++11 } } ++ ++struct Fragment ++{ ++ int off; ++ constexpr Fragment(int _off) : off(_off) { } ++ constexpr Fragment() : Fragment(1) { } ++}; ++ ++struct Field ++{ ++ Fragment fragments[3]; ++ constexpr Field(int off) : fragments{{off}} { } ++}; ++ ++constexpr Field field{0}; ++ ++static_assert(field.fragments[0].off == 0 ++&& field.fragments[1].off == 1 ++&& field.fragments[2].off == 1, ""); +-- +2.27.0 + diff --git a/10.1.0/gentoo/README.history b/10.1.0/gentoo/README.history index d7a8c51..deee08f 100644 --- a/10.1.0/gentoo/README.history +++ b/10.1.0/gentoo/README.history @@ -1,6 +1,7 @@ 2 TODO + 29_all_fix-float-hang-PR95118.patch + 30_all_lto-intl-workaround-PR95194.patch + + 31_all_ctor-range-PR95241.patch 1 05 May 2020 + 01_all_default-fortify-source.patch
[gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/
commit: 0364868c119730d972ce101909856db7385513b6 Author: Sergei Trofimovich gentoo org> AuthorDate: Tue May 19 22:02:16 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Tue May 19 22:02:16 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=0364868c 10.1.0: Trick libintl not to use '_INTL_REDIRECT_ASM' mode as it's incompatible with LTO builds. glibc does not normally use libintl implementations and uses it's own primitives. But musl ond others do fall back to libintl. Reported-by: Andrew Savchenko Bug: https://bugs.gentoo.org/723370 Bug: https://gcc.gnu.org/PR95194 Signed-off-by: Sergei Trofimovich gentoo.org> .../gentoo/30_all_lto-intl-workaround-PR95194.patch | 20 10.1.0/gentoo/README.history | 1 + 2 files changed, 21 insertions(+) diff --git a/10.1.0/gentoo/30_all_lto-intl-workaround-PR95194.patch b/10.1.0/gentoo/30_all_lto-intl-workaround-PR95194.patch new file mode 100644 index 000..9613216 --- /dev/null +++ b/10.1.0/gentoo/30_all_lto-intl-workaround-PR95194.patch @@ -0,0 +1,20 @@ +Trick libintl not to use '_INTL_REDIRECT_ASM' mode as it's +incompatible with LTO builds. + +glibc does not normally use libintl implementations and uses +it's own primitives. But musl ond others do fall back to libintl. + +Reported-by: Andrew Savchenko +Bug: https://bugs.gentoo.org/723370 +Bug: https://gcc.gnu.org/PR95194 +--- a/intl/libgnuintl.h b/intl/libgnuintl.h +@@ -93,7 +93,7 @@ extern "C" { +If he doesn't, we choose the method. A third possible method is +_INTL_REDIRECT_ASM, supported only by GCC. */ + #if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS) +-# if __GNUC__ >= 2 && !defined __APPLE_CC__ && (defined __STDC__ || defined __cplusplus) ++# if __GNUC__ >= 2 && !defined __APPLE_CC__ && (defined __STDC__ || defined __cplusplus) && USE_ASM_ALIASES_THAT_BREAK_LTO + # define _INTL_REDIRECT_ASM + # else + # ifdef __cplusplus diff --git a/10.1.0/gentoo/README.history b/10.1.0/gentoo/README.history index 0ed3a9d..d7a8c51 100644 --- a/10.1.0/gentoo/README.history +++ b/10.1.0/gentoo/README.history @@ -1,5 +1,6 @@ 2 TODO + 29_all_fix-float-hang-PR95118.patch + + 30_all_lto-intl-workaround-PR95194.patch 1 05 May 2020 + 01_all_default-fortify-source.patch
[gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/
commit: c355f9b13f537be7717c3dafe1510976cdb8584e Author: Sergei Trofimovich gentoo org> AuthorDate: Thu May 14 17:57:26 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Thu May 14 17:57:26 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=c355f9b1 10.1.0: backport infinite loop in float print, bug #722774 Reported-by: Adrien Dessemond Bug: https://gcc.gnu.org/PR95118 Bug: https://bugs.gentoo.org/722774 Signed-off-by: Sergei Trofimovich gentoo.org> 10.1.0/gentoo/29_all_fix-float-hang-PR95118.patch | 54 +++ 10.1.0/gentoo/README.history | 3 ++ 2 files changed, 57 insertions(+) diff --git a/10.1.0/gentoo/29_all_fix-float-hang-PR95118.patch b/10.1.0/gentoo/29_all_fix-float-hang-PR95118.patch new file mode 100644 index 000..5be8649 --- /dev/null +++ b/10.1.0/gentoo/29_all_fix-float-hang-PR95118.patch @@ -0,0 +1,54 @@ +https://gcc.gnu.org/PR95118 +https://bugs.gentoo.org/722774 + +From 568c985113b29574c4e25e1a016475668fc17c28 Mon Sep 17 00:00:00 2001 +From: Richard Biener +Date: Thu, 14 May 2020 08:53:03 +0200 +Subject: [PATCH] middle-end/95118 - fix printing of denormal zero + +This fixes printing a REAL_CST generated from value-numbering +punning some bits to a real which turns out as zero with big +negative exponent. This causes the loop in real_to_decimal_for_mode to +never terminate. + +2020-05-14 Richard Biener + + PR middle-end/95118 + * real.c (real_to_decimal_for_mode): Make sure we handle + a zero with nonzero exponent. + + * gcc.dg/pr95118.c: New testcase. +--- + gcc/real.c | 4 ++-- + gcc/testsuite/gcc.dg/pr95118.c | 11 +++ + +--- a/gcc/real.c b/gcc/real.c +@@ -1714,8 +1714,8 @@ real_to_decimal_for_mode (char *str, const REAL_VALUE_TYPE *r_orig, + + do_multiply (, , ten); + +-/* Stop if we're now >= 1. */ +-if (REAL_EXP () > 0) ++/* Stop if we're now >= 1 or zero. */ ++if (REAL_EXP () > 0 || u.cl == rvc_zero) + break; + + v = u; +--- /dev/null b/gcc/testsuite/gcc.dg/pr95118.c +@@ -0,0 +1,11 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O2 -fdump-tree-fre" } */ ++ ++void a(); ++void b() { ++union { ++ int c[4]; ++ long double d; ++} e = {{0, 0, 4}}; ++a(e.d); ++} +-- +2.26.2 + diff --git a/10.1.0/gentoo/README.history b/10.1.0/gentoo/README.history index 96d5640..0ed3a9d 100644 --- a/10.1.0/gentoo/README.history +++ b/10.1.0/gentoo/README.history @@ -1,3 +1,6 @@ +2 TODO + + 29_all_fix-float-hang-PR95118.patch + 1 05 May 2020 + 01_all_default-fortify-source.patch + 02_all_default-warn-format-security.patch
[gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/
commit: 48b3e04f8e6a5906ef0a36f1cac58a3ecdc020e7 Author: Sergei Trofimovich gentoo org> AuthorDate: Thu May 7 18:35:26 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Thu May 7 18:35:26 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=48b3e04f 10.1.0: copy patches frm 9.3.0 and refresh them Changes are: 2 upstreamed patches are removed: - 12_all_pr55930-dependency-tracking.patch - 25_all_ia64-bootstrap.patch 1 patch is updated: - 11_all_extra-options.patch is split in two: + 27_all_EXTRA_OPTIONS-z-now.patch + 28_all_EXTRA_OPTIONS-fstack-clash-protection.patch Signed-off-by: Sergei Trofimovich gentoo.org> 10.1.0/gentoo/01_all_default-fortify-source.patch | 22 .../02_all_default-warn-format-security.patch | 22 .../gentoo/03_all_default-warn-trampolines.patch | 13 ++ 10.1.0/gentoo/04_all_nossp-on-nostdlib.patch | 27 10.1.0/gentoo/05_all_alpha-mieee-default.patch | 39 ++ 10.1.0/gentoo/06_all_ia64_note.GNU-stack.patch | 92 + .../gentoo/07_all_i386_libgcc_note.GNU-stack.patch | 54 10.1.0/gentoo/08_all_libiberty-asprintf.patch | 18 +++ 10.1.0/gentoo/09_all_libiberty-pic.patch | 10 ++ 10.1.0/gentoo/10_all_nopie-all-flags.patch | 18 +++ 10.1.0/gentoo/11_all_sh-drop-sysroot-suffix.patch | 32 + 10.1.0/gentoo/12_all_ia64-TEXTREL.patch| 22 .../gentoo/13_all_disable-systemtap-switch.patch | 122 ++ 10.1.0/gentoo/14_all_m68k-textrel-on-libgcc.patch | 93 ++ 10.1.0/gentoo/15_all_respect-build-cxxflags.patch | 39 ++ 10.1.0/gentoo/16_all_libgfortran-Werror.patch | 20 +++ 10.1.0/gentoo/17_all_libgomp-Werror.patch | 20 +++ 10.1.0/gentoo/18_all_libitm-Werror.patch | 19 +++ 10.1.0/gentoo/19_all_libatomic-Werror.patch| 19 +++ 10.1.0/gentoo/20_all_libbacktrace-Werror.patch | 17 +++ 10.1.0/gentoo/21_all_libsanitizer-Werror.patch | 17 +++ 10.1.0/gentoo/22_all_libstdcxx-no-vtv.patch| 61 + 10.1.0/gentoo/23_all_disable-riscv32-ABIs.patch| 53 10.1.0/gentoo/24_all_default_ssp-buffer-size.patch | 14 ++ 10.1.0/gentoo/25_all_hppa-faster-synth_mult.patch | 44 +++ 10.1.0/gentoo/26_all_libcpp-ar.patch | 143 + 10.1.0/gentoo/27_all_EXTRA_OPTIONS-z-now.patch | 26 ...all_EXTRA_OPTIONS-fstack-clash-protection.patch | 65 ++ 10.1.0/gentoo/README.history | 29 + 29 files changed, 1170 insertions(+) diff --git a/10.1.0/gentoo/01_all_default-fortify-source.patch b/10.1.0/gentoo/01_all_default-fortify-source.patch new file mode 100644 index 000..d307474 --- /dev/null +++ b/10.1.0/gentoo/01_all_default-fortify-source.patch @@ -0,0 +1,22 @@ +Taken Debian's patch and removed docs matches: +https://salsa.debian.org/toolchain-team/gcc.git +Also see https://bugs.gentoo.org/621036 where +initially Gentoo used too complicated macro. + +# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++, +# DP: if the optimization level is > 0 +--- a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c +@@ -951,6 +951,12 @@ c_cpp_builtins (cpp_reader *pfile) + builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0); + builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0); + ++#if !defined(ACCEL_COMPILER) ++ /* Fortify Source enabled by default for optimization levels > 0 */ ++ if (optimize) ++builtin_define_with_int_value ("_FORTIFY_SOURCE", 2); ++#endif ++ + /* Misc. */ + if (flag_gnu89_inline) + cpp_define (pfile, "__GNUC_GNU_INLINE__"); diff --git a/10.1.0/gentoo/02_all_default-warn-format-security.patch b/10.1.0/gentoo/02_all_default-warn-format-security.patch new file mode 100644 index 000..f809abd --- /dev/null +++ b/10.1.0/gentoo/02_all_default-warn-format-security.patch @@ -0,0 +1,22 @@ +Enable -Wformat and -Wformat-security by default. + +--- a/gcc/c-family/c.opt 2016-03-23 18:51:56.0 +0100 b/gcc/c-family/c.opt 2016-04-28 23:45:54.063351272 +0200 +@@ -459,7 +459,7 @@ C ObjC C++ ObjC++ Var(warn_format_nonlit + Warn about format strings that are not literals. + + Wformat-security +-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0) ++C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0) + Warn about possible security problems with format functions. + + Wformat-signedness +@@ -475,7 +475,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_l + Warn about zero-length formats. + + Wformat= +-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2) ++C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning