summaryrefslogtreecommitdiff
path: root/sys-devel/gcc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-10-18 21:57:33 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-10-18 21:57:33 +0100
commit99c41a033e7745ed8aa9ffbf0f9e1e414e80da4a (patch)
treed7dd421828aea0525f9e8fad6380cdf6daf1ec04 /sys-devel/gcc
parente903f5ad5c87da9f55a9c9fa0d0e5c531d25af3f (diff)
gentoo auto-resync : 18:10:2023 - 21:57:33
Diffstat (limited to 'sys-devel/gcc')
-rw-r--r--sys-devel/gcc/Manifest2
-rw-r--r--sys-devel/gcc/files/gcc-14.0.0_pre20231015-pycryptodome-ice.patch212
-rw-r--r--sys-devel/gcc/gcc-14.0.0_pre20231015-r1.ebuild65
3 files changed, 279 insertions, 0 deletions
diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
index 2f3cb27a1548..ce13ee5c1ae8 100644
--- a/sys-devel/gcc/Manifest
+++ b/sys-devel/gcc/Manifest
@@ -1,5 +1,6 @@
AUX gcc-13-fix-cross-fixincludes.patch 792 BLAKE2B f16dcfee5760380931642520bf7ae939a22131183dec4f9515cabeabaa2eafbc339d4f8bdc0605bda45d840876cb8720264c4612d99510b4d7a2e4132db2403e SHA512 d65061e07c5f3089a9d39edafed94c39082dbb254cfebb386fa2fce5374e54e3e1e15a84f0de96adbe1c5ebfc33a5dad10ecbd3db851f852ec1a7521b8940fc5
AUX gcc-14.0.0_pre20231001-pgo-bootstrap.patch 1635 BLAKE2B b866f590fd67894e891937097b2cf784309a4f48106939c1f44d5096e8b5c255db2bce3c172b38b4b622506a9aa76b586abfcae36cce931b08c2e8bdba072d93 SHA512 374a16cd48ef6c1c796f602a240c1529b1bacf500e1b098396af64c4b756467cbf17897843cabda36b8f78b00e6768ac4a32bcaf4f863513251c91c10f97d800
+AUX gcc-14.0.0_pre20231015-pycryptodome-ice.patch 7557 BLAKE2B cd6e4eb08b0546a13e02d719371c7bfff0a1d70c1eacdfb891be80663b09272f06367d747c98e9086072af8da6b39577acd8f6b4282b742542d9bd710bc734de SHA512 b9002896d83ebd77ca23826e1f59085873828c5d876f36ae177d5bf3c1a70dd1d38ea40e9622b84bd80262ce8b5f14670c01ba246c5348a913788e8be8e2e8d5
AUX gcc-configure-LANG.patch 2052 BLAKE2B 28c36f4992e41305ee421dade5eaaac34e3bdc523665b03f360f2bc01e8f69e9dc48052edb80dece63ab561e80325b4f125502482eb16f7324f1c03670021550 SHA512 a694c7ac2f45cc657097ff5b0cf1356ac88a9c06035c9ba15167e9d444844d0d8a478eb1b9b62195dd063774f79697b9148b9cdb6c261640b472c291061b2129
AUX gcc-configure-texinfo.patch 341 BLAKE2B d2ea3b2ea08f5d3a498ba27d0fb95e325097e2104e55caa28b66515cb48662649140d90b639369aedc54b2b1178fa4b49cda442f5f504e09d88a2efa45a5057c SHA512 e8d34c5077409df5495cf0c5fbf5e77f841c5698108fa6a5fde33eb28202c685603bdefd8368918e55f30c4b995e895d71d64c715c1ec2b017e09eb2c54c09ff
DIST gcc-10-20230426.tar.xz 72118868 BLAKE2B d87cfd78d96585877abc20ed213e4d2fba36556279a5bce5d185de34a59f8cde1250d7322543533922ef224ac8508c1d3fe597c652a648e6e7f08bc19cb2f11c SHA512 805fbb840e6bd8cdd53f954b13c768c0ea0635c099094f6f0b0b04f00120dcde7cf3950a01e199d674b39ff764e9119a548b2f7a156ab2b5d598bd68ed56ce24
@@ -74,6 +75,7 @@ EBUILD gcc-14.0.0_pre20230917.ebuild 1595 BLAKE2B 6986a9323f7bbc6c814b68b40333c6
EBUILD gcc-14.0.0_pre20230924.ebuild 1595 BLAKE2B 6986a9323f7bbc6c814b68b40333c6279ba7f1b1733695b12568e59390b991441b03523b015fdf67e8b0249fdf874e36a46993d2357d9b24b3a97b79ca4bf8fd SHA512 c2cc081c84cd0846da49b81e7835e8b35365d51c4a014edb765a410e4a7b528928f32fedbca2e40aa0d2da80ccebaadada67c1b746a70b6e7910d71503cc6097
EBUILD gcc-14.0.0_pre20231001.ebuild 1642 BLAKE2B 04874e9c2ede537422ae1bb8d8b122fefeb4d3812ec9e85b6ffb8e2a457a5806e8c7dc55b7f7422d3bcd641778c0b0c211d872e374c7c8d6725c2513fb228f36 SHA512 c8cb5389164bd64b9b43545143dfe59cef4cb693e44ac1b49ab6635119b2dc09e84ed92614f9e5b9176645759b20af9d0599319c2cbc5b79ea11a7370f3dec83
EBUILD gcc-14.0.0_pre20231008.ebuild 1595 BLAKE2B 3d806ab58dc813a0a0f5e69ccfccab32f9b84d205d0283ff7b8b67abf2524aaeb931109f20ee4aa0b739537ee45289328f18521f1a177aaee81416e156975cfa SHA512 fc1b571afaac02359352b633986d0f60fa5108c367c6faab8814f34faefda6eab735599788a13e8448cdddf4d22a803fbef962c50de6442294ca01dd1cfff09f
+EBUILD gcc-14.0.0_pre20231015-r1.ebuild 1645 BLAKE2B 5c415060b0f52dced66e063f6042e957cc224a02155f9137ffc4c3ca9d08506e05a167900b515e4c4cf672345cfd0b841eac8cfe228c3d216a8be208d909a351 SHA512 1916ee3a7b10a7451db8e32e45aac2f134eceb8128ee98f50d59682fc4a652d58e15b8330fa9ed2cb1c50fcafd39775bb05e7cfb23b826cc1c1b91f64cb60ae9
EBUILD gcc-14.0.0_pre20231015.ebuild 1595 BLAKE2B f9c2f4064261aef1eb00db9cecb1741e97a1ccb4fe120a2e219eb81cd78ca59ea5e5cfb250079adff07a377044f9edb8de9a514fa1a3bde333e25339756223c8 SHA512 6a338c67a9637d294f551f300317c2caf54cd740858de5b51327b07b4e2aff12d7ec04eecff53be35e33a2f5d8d8cb74c381441f1e12c3d3da0a8ae1ef9c70a6
EBUILD gcc-8.5.0-r1.ebuild 498 BLAKE2B e24f62fdb50bf2e9957cbb85c72adc96d369938a7f552735772de964f7023b8b34bd11e7e544d268cc308e25272084a728bd061f37c568d42ea65d55bb2a2e93 SHA512 f35b353e9f54eb3e1c6f8e0ea262458b41da9bddb993793aff79f765c4d93811744979d34e50c6470a9b2cfb63b7006bd284d819b7a98e56a8b3a34ae570ae76
EBUILD gcc-9.5.0.ebuild 1206 BLAKE2B 262931215488db54cab2141549f997a48e22d0a917917eb670d41d5b155c7685e92eb1bc3843d2eca47dd15a450199aea5d99777d2870ff09b1a79ac8a63bcb0 SHA512 3737a70e70e53a581280ff1449d7d92bb9ffba0919b618ea43d4747e09b2803795a05c07c0e3a2ec8982f8d5594be58f9ac549d329b18dc236ad5159e4a47132
diff --git a/sys-devel/gcc/files/gcc-14.0.0_pre20231015-pycryptodome-ice.patch b/sys-devel/gcc/files/gcc-14.0.0_pre20231015-pycryptodome-ice.patch
new file mode 100644
index 000000000000..377f68511f78
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-14.0.0_pre20231015-pycryptodome-ice.patch
@@ -0,0 +1,212 @@
+https://gcc.gnu.org/PR111845
+https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=f1744dd50bb1661c98b694ff907cb0a1be4f6134
+
+From f1744dd50bb1661c98b694ff907cb0a1be4f6134 Mon Sep 17 00:00:00 2001
+From: Jakub Jelinek <jakub@redhat.com>
+Date: Wed, 18 Oct 2023 12:37:40 +0200
+Subject: [PATCH] tree-ssa-math-opts: Fix up match_uaddc_usubc [PR111845]
+
+GCC ICEs on the first testcase. Successful match_uaddc_usubc ends up with
+some dead stmts which DCE will remove (hopefully) later all.
+The ICE is because one of the dead stmts refers to a freed SSA_NAME.
+The code already gsi_removes a couple of stmts in the
+ /* Remove some statements which can't be kept in the IL because they
+ use SSA_NAME whose setter is going to be removed too. */
+section for the same reason (the reason for the freed SSA_NAMEs is that
+we don't really have a replacement for those cases - all we have after
+a match is combined overflow from the addition/subtraction of 2 operands + a
+[0, 1] carry in, but not the individual overflows from the former 2
+additions), but for the last (most significant) limb case, where we try
+to match x = op1 + op2 + carry1 + carry2; or
+x = op1 - op2 - carry1 - carry2; we just gsi_replace the final stmt, but
+left around the 2 temporary stmts as dead; if we were unlucky enough that
+those referenced the carry flag that went away, it ICEs.
+
+So, the following patch remembers those temporary statements (rather than
+trying to rediscover them more expensively) and removes them before the
+final one is replaced.
+
+While working on it, I've noticed we didn't support all the reassociated
+possibilities of writing the addition of 4 operands or subtracting 3
+operands from one, we supported e.g.
+x = ((op1 + op2) + op3) + op4;
+x = op1 + ((op2 + op3) + op4);
+but not
+x = (op1 + (op2 + op3)) + op4;
+x = op1 + (op2 + (op3 + op4));
+Fixed by the change to inspect also rhs[2] when rhs[1] didn't yield what
+we were searching for (if non-NULL) - rhs[0] is inspected in the first
+loop and has different handling for the MINUS_EXPR case.
+
+2023-10-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/111845
+ * tree-ssa-math-opts.cc (match_uaddc_usubc): Remember temporary
+ statements for the 4 operand addition or subtraction of 3 operands
+ from 1 operand cases and remove them when successful. Look for
+ nested additions even from rhs[2], not just rhs[1].
+
+ * gcc.dg/pr111845.c: New test.
+ * gcc.target/i386/pr111845.c: New test.
+---
+ gcc/testsuite/gcc.dg/pr111845.c | 16 ++++++++
+ gcc/testsuite/gcc.target/i386/pr111845.c | 47 +++++++++++++++++++++++
+ gcc/tree-ssa-math-opts.cc | 48 +++++++++++++++---------
+ 3 files changed, 94 insertions(+), 17 deletions(-)
+ create mode 100644 gcc/testsuite/gcc.dg/pr111845.c
+ create mode 100644 gcc/testsuite/gcc.target/i386/pr111845.c
+
+diff --git a/gcc/testsuite/gcc.dg/pr111845.c b/gcc/testsuite/gcc.dg/pr111845.c
+new file mode 100644
+index 000000000000..1bcb4f88e6f1
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/pr111845.c
+@@ -0,0 +1,16 @@
++/* PR tree-optimization/111845 */
++/* { dg-do compile } */
++/* { dg-options "-O2 --param tree-reassoc-width=2" } */
++
++int a, b;
++unsigned int c, d, e;
++
++void
++foo (int x)
++{
++ b += d;
++ c += b < d;
++ b += e = a < x;
++ c += b;
++ c += b < e;
++}
+diff --git a/gcc/testsuite/gcc.target/i386/pr111845.c b/gcc/testsuite/gcc.target/i386/pr111845.c
+new file mode 100644
+index 000000000000..d52110a40422
+--- /dev/null
++++ b/gcc/testsuite/gcc.target/i386/pr111845.c
+@@ -0,0 +1,47 @@
++/* PR tree-optimization/111845 */
++/* { dg-do compile } */
++/* { dg-options "-O2 -g -masm=att" } */
++/* { dg-final { scan-assembler-times "\tadcq\t" 8 { target lp64 } } } */
++/* { dg-final { scan-assembler-times "\tadcl\t" 8 { target ia32 } } } */
++
++unsigned long l, m;
++
++__attribute__((noipa)) void
++foo (unsigned long x, unsigned long y, unsigned long h, unsigned long i, int a, int b)
++{
++ unsigned long c, d;
++ unsigned long e = __builtin_add_overflow (x, y, &c);
++ unsigned long f = __builtin_add_overflow (c, a < b, &d);
++ m = ((h + i) + e) + f;
++ l = d;
++}
++
++__attribute__((noipa)) void
++bar (unsigned long x, unsigned long y, unsigned long h, unsigned long i, int a, int b)
++{
++ unsigned long c, d;
++ unsigned long e = __builtin_add_overflow (x, y, &c);
++ unsigned long f = __builtin_add_overflow (c, a < b, &d);
++ m = (h + (i + e)) + f;
++ l = d;
++}
++
++__attribute__((noipa)) void
++baz (unsigned long x, unsigned long y, unsigned long h, unsigned long i, int a, int b)
++{
++ unsigned long c, d;
++ unsigned long e = __builtin_add_overflow (x, y, &c);
++ unsigned long f = __builtin_add_overflow (c, a < b, &d);
++ m = h + (i + (e + f));
++ l = d;
++}
++
++__attribute__((noipa)) void
++qux (unsigned long x, unsigned long y, unsigned long h, unsigned long i, int a, int b)
++{
++ unsigned long c, d;
++ unsigned long e = __builtin_add_overflow (x, y, &c);
++ unsigned long f = __builtin_add_overflow (c, a < b, &d);
++ m = h + ((i + e) + f);
++ l = d;
++}
+diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc
+index 51c14d6bad9f..363f31646691 100644
+--- a/gcc/tree-ssa-math-opts.cc
++++ b/gcc/tree-ssa-math-opts.cc
+@@ -4581,6 +4581,7 @@ match_uaddc_usubc (gimple_stmt_iterator *gsi, gimple *stmt, tree_code code)
+ if (!INTEGRAL_TYPE_P (type) || !TYPE_UNSIGNED (type))
+ return false;
+
++ auto_vec<gimple *, 2> temp_stmts;
+ if (code != BIT_IOR_EXPR && code != BIT_XOR_EXPR)
+ {
+ /* If overflow flag is ignored on the MSB limb, we can end up with
+@@ -4615,26 +4616,29 @@ match_uaddc_usubc (gimple_stmt_iterator *gsi, gimple *stmt, tree_code code)
+ rhs[0] = gimple_assign_rhs1 (g);
+ tree &r = rhs[2] ? rhs[3] : rhs[2];
+ r = r2;
++ temp_stmts.quick_push (g);
+ }
+ else
+ break;
+ }
+- while (TREE_CODE (rhs[1]) == SSA_NAME && !rhs[3])
+- {
+- gimple *g = SSA_NAME_DEF_STMT (rhs[1]);
+- if (has_single_use (rhs[1])
+- && is_gimple_assign (g)
+- && gimple_assign_rhs_code (g) == PLUS_EXPR)
+- {
+- rhs[1] = gimple_assign_rhs1 (g);
+- if (rhs[2])
+- rhs[3] = gimple_assign_rhs2 (g);
+- else
+- rhs[2] = gimple_assign_rhs2 (g);
+- }
+- else
+- break;
+- }
++ for (int i = 1; i <= 2; ++i)
++ while (rhs[i] && TREE_CODE (rhs[i]) == SSA_NAME && !rhs[3])
++ {
++ gimple *g = SSA_NAME_DEF_STMT (rhs[i]);
++ if (has_single_use (rhs[i])
++ && is_gimple_assign (g)
++ && gimple_assign_rhs_code (g) == PLUS_EXPR)
++ {
++ rhs[i] = gimple_assign_rhs1 (g);
++ if (rhs[2])
++ rhs[3] = gimple_assign_rhs2 (g);
++ else
++ rhs[2] = gimple_assign_rhs2 (g);
++ temp_stmts.quick_push (g);
++ }
++ else
++ break;
++ }
+ /* If there are just 3 addends or one minuend and two subtrahends,
+ check for UADDC or USUBC being pattern recognized earlier.
+ Say r = op1 + op2 + ovf1 + ovf2; where the (ovf1 + ovf2) part
+@@ -5039,7 +5043,17 @@ match_uaddc_usubc (gimple_stmt_iterator *gsi, gimple *stmt, tree_code code)
+ g = gimple_build_assign (ilhs, IMAGPART_EXPR,
+ build1 (IMAGPART_EXPR, TREE_TYPE (ilhs), nlhs));
+ if (rhs[2])
+- gsi_insert_before (gsi, g, GSI_SAME_STMT);
++ {
++ gsi_insert_before (gsi, g, GSI_SAME_STMT);
++ /* Remove some further statements which can't be kept in the IL because
++ they can use SSA_NAMEs whose setter is going to be removed too. */
++ while (temp_stmts.length ())
++ {
++ g = temp_stmts.pop ();
++ gsi2 = gsi_for_stmt (g);
++ gsi_remove (&gsi2, true);
++ }
++ }
+ else
+ gsi_replace (gsi, g, true);
+ /* Remove some statements which can't be kept in the IL because they
+--
+2.39.3
diff --git a/sys-devel/gcc/gcc-14.0.0_pre20231015-r1.ebuild b/sys-devel/gcc/gcc-14.0.0_pre20231015-r1.ebuild
new file mode 100644
index 000000000000..3e4f9224d3e3
--- /dev/null
+++ b/sys-devel/gcc/gcc-14.0.0_pre20231015-r1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="14.0.0"
+PATCH_VER="4"
+MUSL_VER="1"
+MUSL_GCC_VER="14.0.0"
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=master
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND=">=${CATEGORY}/binutils-2.30[cet(-)?]"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply "${FILESDIR}"/${P}-pycryptodome-ice.patch
+ eapply_user
+}