summaryrefslogtreecommitdiff
path: root/sys-devel/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/gcc')
-rw-r--r--sys-devel/gcc/Manifest4
-rw-r--r--sys-devel/gcc/files/gcc-13.0.1_pre20230409-PR109434-DSE-throw.patch63
-rw-r--r--sys-devel/gcc/files/gcc-13.0.1_pre20230409-PR109469-SLP-returns-twice.patch66
-rw-r--r--sys-devel/gcc/gcc-13.0.1_pre20230409-r2.ebuild57
-rw-r--r--sys-devel/gcc/gcc-13.0.1_pre20230409-r3.ebuild58
5 files changed, 248 insertions, 0 deletions
diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
index 837a1a048dd8..b3b090606473 100644
--- a/sys-devel/gcc/Manifest
+++ b/sys-devel/gcc/Manifest
@@ -1,5 +1,7 @@
AUX gcc-13.0.1_pre20230326-76_all_all_PR109265_PR109274_PR109325_range_def_chain.patch 6907 BLAKE2B 3fcbedc9b330207972a17d5b48a307911b0a94ec0f2a0e9bc22b39f8c7ca0cf0709afbf2af69d7d8596393ad163db043848c2f3cc9352060a4cb1bb4f673fa92 SHA512 a5988d63a182eda8da6cb95269e9474323b5681cba7d91f1dae71fb914ff0b210fac092d94e4427c8065e0a44cd1e4b96de08fd0267eeda88dd0ba96c556c742
AUX gcc-13.0.1_pre20230402-PR109304-ICE-python3.12.patch 2394 BLAKE2B f6b8cdbf2a9c048feee65484d4d97dc9740718541c6ec6fc85b25f02b72a2b19cfd11883ebee3a6debaa61945416c09f4ad767b8cb68b85192949ce168394f5c SHA512 1914631ff344687b16d6a9363faf7ddf270fbf4093962d93c3f9f1009b49895b4bb9e4eca1e8794bd59a33e6568325e28b15a20ec260cc1dd340e4960c62aa2c
+AUX gcc-13.0.1_pre20230409-PR109434-DSE-throw.patch 1856 BLAKE2B 55e5516c449e8f6c9968b914ec708331a5ef347b2be0d80f50c064d52e76229e4df3b325a99a57f5afe254ce57699bc628dcdd7a4d9a6f715183cd622116ef6b SHA512 f9f870949f80d725b6dc577f4c25867463c5258f97b35804ac526c708ac94feaf4dacb01171452c188b5d438321d07a9d31ac24e68466a9a459a6f86274a0978
+AUX gcc-13.0.1_pre20230409-PR109469-SLP-returns-twice.patch 1930 BLAKE2B e5c5465b88a1b00afe3c85d1e4775b4fc1f19667d7e5c3e74a944fd9150d15f804b783d0f0696f0af8957368d270bc4b032a920fbff51eea09c34008e1dfc692 SHA512 0f9f6b1e94300f6351c608b09b649bdde283f84a0b4b1c5f81393075367c05a2b9986bf8bfabb560392ecd70275de9bd8230e6fbfd8af523c489f094361b9137
AUX gcc-configure-LANG.patch 2052 BLAKE2B 28c36f4992e41305ee421dade5eaaac34e3bdc523665b03f360f2bc01e8f69e9dc48052edb80dece63ab561e80325b4f125502482eb16f7324f1c03670021550 SHA512 a694c7ac2f45cc657097ff5b0cf1356ac88a9c06035c9ba15167e9d444844d0d8a478eb1b9b62195dd063774f79697b9148b9cdb6c261640b472c291061b2129
AUX gcc-configure-texinfo.patch 341 BLAKE2B d2ea3b2ea08f5d3a498ba27d0fb95e325097e2104e55caa28b66515cb48662649140d90b639369aedc54b2b1178fa4b49cda442f5f504e09d88a2efa45a5057c SHA512 e8d34c5077409df5495cf0c5fbf5e77f841c5698108fa6a5fde33eb28202c685603bdefd8368918e55f30c4b995e895d71d64c715c1ec2b017e09eb2c54c09ff
DIST gcc-10-20230119.tar.xz 72112952 BLAKE2B 6e28cba9f6ff5c9f9231828bb400c82b8658a4f9c0166c28a6a12d71728d4460904152a8c84bbeff88c06b7f9378937b7b61bf4a871a10c56bd005170dc5fde2 SHA512 6cbb567ef1da1b6fa65892b6e71c3b7cd37e0c483e049720ea1987d444a0e7b4eb15d1e99f4e35995acdce560a811a779574eeba52bb252c61325accedd6a5c5
@@ -52,6 +54,8 @@ EBUILD gcc-12.2.1_p20230408.ebuild 1486 BLAKE2B dad7755246a60881d0ca2df86aca1a56
EBUILD gcc-12.3.9999.ebuild 1593 BLAKE2B 0cac4b67933abbacf0037f3e89b4209ea2a8147b62d4c2b6e61701711ee421d240899c4c9bdb201cdfceef14125227109b4c5c3524256a06b206887a4d0f142e SHA512 ac75c2434ba6a36655749ed371b158360a7e05570ed41e39dac0a15ac6eb24810f2408a2d30e50206e4250c567123377e14317c07ab1e6b5771599a3b5e0ced0
EBUILD gcc-13.0.1.9999.ebuild 1307 BLAKE2B 71019cdeaf209a3c82cb4c6c2a4d6827f027da17073f359d762cca422b2f67cd127b43b184a26b0d6a3ce5b83d92270b0a5ab6d832c31e28619dec9b5f4fff8a SHA512 5e4faf9e4e1cdb5683c7e66d270910c7f36a6c4504faf3810a562fac93513e20ca9b98dfe7b7a7441c9dffffc01c861609545fc7e36fe7a8081b636adc290dfc
EBUILD gcc-13.0.1_pre20230409-r1.ebuild 1354 BLAKE2B b1dcf92771940c65b4862f76107df49bdc811c279fa33205cc63d8ed74ceed786712e42a7c050e691a30494b3b55c7bcf62e14d7baa2550c392b7d0bac0007d0 SHA512 4e49f8ea0487bd4cf57a2518647e1dc1f82e1b891a200463f2c17f6285b67070abd1d732ef2c578389a927f142495b3f721a6017f211684b27a3f5ce903cd774
+EBUILD gcc-13.0.1_pre20230409-r2.ebuild 1414 BLAKE2B 800e6b88062a76573c5aa578d110279b9a5fefd8f1fb343a34b4143a98a5a6a16530df0901fefc594f6bdf6ce097041ce3bf4ee9d675e6edc5c4bc3744908096 SHA512 92a999cc70ad9c0f25affd67de4b1d7974c4f0df9373a5e39dba37329fe40de4c417bba494122846f1834abb4262407a2e6046facf641495a61e0fe0ab07944e
+EBUILD gcc-13.0.1_pre20230409-r3.ebuild 1466 BLAKE2B b7e13173a533de6b8c5e546e2b8744934cb0ad3a2277fb6e7bf8f4a69444a215c1069d07e5d83d81d08d3ce67e05a541a0a5d4b0c1de7256257fa4bfb6863ca1 SHA512 32ac41406e31d0a3785b35621775b7d8f7eb3ddded2d72028ad173f7363009b1895c5d466e2fd148b3927038d47ca20947214d1ebdc5ce9ea0b60ba679156e46
EBUILD gcc-13.0.1_pre20230409.ebuild 1354 BLAKE2B b1dcf92771940c65b4862f76107df49bdc811c279fa33205cc63d8ed74ceed786712e42a7c050e691a30494b3b55c7bcf62e14d7baa2550c392b7d0bac0007d0 SHA512 4e49f8ea0487bd4cf57a2518647e1dc1f82e1b891a200463f2c17f6285b67070abd1d732ef2c578389a927f142495b3f721a6017f211684b27a3f5ce903cd774
EBUILD gcc-8.5.0-r1.ebuild 498 BLAKE2B e24f62fdb50bf2e9957cbb85c72adc96d369938a7f552735772de964f7023b8b34bd11e7e544d268cc308e25272084a728bd061f37c568d42ea65d55bb2a2e93 SHA512 f35b353e9f54eb3e1c6f8e0ea262458b41da9bddb993793aff79f765c4d93811744979d34e50c6470a9b2cfb63b7006bd284d819b7a98e56a8b3a34ae570ae76
EBUILD gcc-9.5.0.ebuild 844 BLAKE2B 719c259a6f39c72f7d1748095a9e649d4ab3dde04b118125313ab9b915eb9cbd038592532185317080dbc46d73a8bd324b498462db73b12d23144cd58378dd9c SHA512 1ed19c79239d155be3b267fcad4d7230821406ba8fb2c11857168fc0e717c4edcd8d7fb0972bc6df0fbcfbd8a9f085aa023f452368278c0e7e0af014c1124d89
diff --git a/sys-devel/gcc/files/gcc-13.0.1_pre20230409-PR109434-DSE-throw.patch b/sys-devel/gcc/files/gcc-13.0.1_pre20230409-PR109434-DSE-throw.patch
new file mode 100644
index 000000000000..5d45d8f4e018
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-13.0.1_pre20230409-PR109434-DSE-throw.patch
@@ -0,0 +1,63 @@
+https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=6e3e708dbadaae7b504af7fc4410015624793f02
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109434
+
+From 6e3e708dbadaae7b504af7fc4410015624793f02 Mon Sep 17 00:00:00 2001
+From: Richard Biener <rguenther@suse.de>
+Date: Tue, 11 Apr 2023 15:06:59 +0200
+Subject: [PATCH] tree-optimization/109434 - bogus DSE of throwing call LHS
+
+The byte tracking of call LHS didn't properly handle possibly
+throwing calls correctly which cases bogus DSE and in turn, for the
+testcase a bogus uninit diagnostic and (unreliable) wrong-code.
+
+ PR tree-optimization/109434
+ * tree-ssa-dse.cc (initialize_ao_ref_for_dse): Properly
+ handle possibly throwing calls when processing the LHS
+ and may-defs are not OK.
+
+ * g++.dg/opt/pr109434.C: New testcase.
+--- /dev/null
++++ b/gcc/testsuite/g++.dg/opt/pr109434.C
+@@ -0,0 +1,28 @@
++// { dg-do compile }
++// { dg-require-effective-target c++17 }
++// { dg-options "-O2 -Wall" }
++
++#include <optional>
++#include <stdexcept>
++
++std::optional<int> foo()
++{
++ volatile int x = 1;
++ if (x)
++ throw std::runtime_error("haha");
++ return 42;
++}
++
++int main()
++{
++ std::optional<int> optInt;
++ try {
++ // We falsely DSEd the LHS of the call even though foo throws
++ // which results in an uninitialized diagnostic
++ optInt = foo();
++ } catch (...) {
++ return optInt.has_value();
++ }
++ std::optional<double> optDbl{optInt};
++ return optDbl ? optDbl.value () : 2.0;
++}
+--- a/gcc/tree-ssa-dse.cc
++++ b/gcc/tree-ssa-dse.cc
+@@ -179,7 +179,8 @@ initialize_ao_ref_for_dse (gimple *stmt, ao_ref *write, bool may_def_ok = false)
+ }
+ if (tree lhs = gimple_get_lhs (stmt))
+ {
+- if (TREE_CODE (lhs) != SSA_NAME)
++ if (TREE_CODE (lhs) != SSA_NAME
++ && (may_def_ok || !stmt_could_throw_p (cfun, stmt)))
+ {
+ ao_ref_init (write, lhs);
+ return true;
+--
+2.31.1
diff --git a/sys-devel/gcc/files/gcc-13.0.1_pre20230409-PR109469-SLP-returns-twice.patch b/sys-devel/gcc/files/gcc-13.0.1_pre20230409-PR109469-SLP-returns-twice.patch
new file mode 100644
index 000000000000..7d45c9e60af8
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-13.0.1_pre20230409-PR109469-SLP-returns-twice.patch
@@ -0,0 +1,66 @@
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109469
+https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=2d7ad38707e1fd71193d440198cc0726092b9015
+
+From 2d7ad38707e1fd71193d440198cc0726092b9015 Mon Sep 17 00:00:00 2001
+From: Richard Biener <rguenther@suse.de>
+Date: Tue, 11 Apr 2023 16:06:12 +0200
+Subject: [PATCH] tree-optimization/109469 - SLP with returns-twice region
+ start
+
+The following avoids an SLP region starting with a returns-twice
+call where we cannot insert stmts at the head.
+
+ PR tree-optimization/109469
+ * tree-vect-slp.cc (vect_slp_function): Skip region starts with
+ a returns-twice call.
+
+ * gcc.dg/torture/pr109469.c: New testcase.
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/torture/pr109469.c
+@@ -0,0 +1,15 @@
++/* { dg-do compile } */
++
++__attribute__((returns_twice)) int foo();
++
++struct xio myproc;
++struct xio {
++ void (*read_proc)();
++ void (*write_proc)();
++};
++
++void dummy_write_proc() {
++ switch (foo())
++ default:
++ myproc.read_proc = myproc.write_proc = dummy_write_proc;
++}
+--- a/gcc/tree-vect-slp.cc
++++ b/gcc/tree-vect-slp.cc
+@@ -7671,10 +7671,23 @@ vect_slp_function (function *fun)
+ {
+ r |= vect_slp_bbs (bbs, NULL);
+ bbs.truncate (0);
+- bbs.quick_push (bb);
+ }
+- else
+- bbs.safe_push (bb);
++
++ /* We need to be able to insert at the head of the region which
++ we cannot for region starting with a returns-twice call. */
++ if (bbs.is_empty ())
++ if (gcall *first = safe_dyn_cast <gcall *> (first_stmt (bb)))
++ if (gimple_call_flags (first) & ECF_RETURNS_TWICE)
++ {
++ if (dump_enabled_p ())
++ dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
++ "skipping bb%d as start of region as it "
++ "starts with returns-twice call\n",
++ bb->index);
++ continue;
++ }
++
++ bbs.safe_push (bb);
+
+ /* When we have a stmt ending this block and defining a
+ value we have to insert on edges when inserting after it for
+--
+2.31.1
diff --git a/sys-devel/gcc/gcc-13.0.1_pre20230409-r2.ebuild b/sys-devel/gcc/gcc-13.0.1_pre20230409-r2.ebuild
new file mode 100644
index 000000000000..527b71d68608
--- /dev/null
+++ b/sys-devel/gcc/gcc-13.0.1_pre20230409-r2.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_VER="9"
+PATCH_GCC_VER="13.1.0"
+MUSL_VER="1"
+MUSL_GCC_VER="13.1.0"
+
+if [[ $(ver_cut 3) == 9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=$(($(ver_cut 3) - 9998))
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$(($(ver_cut 2) - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+fi
+
+inherit toolchain
+# Needs to be after inherit (for now?), bug #830908
+EGIT_BRANCH=master
+
+# Don't keyword live ebuilds
+if ! tc_is_live && [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+# KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ KEYWORDS="~loong"
+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}-PR109469-SLP-returns-twice.patch
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-13.0.1_pre20230409-r3.ebuild b/sys-devel/gcc/gcc-13.0.1_pre20230409-r3.ebuild
new file mode 100644
index 000000000000..073f68b644ac
--- /dev/null
+++ b/sys-devel/gcc/gcc-13.0.1_pre20230409-r3.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_VER="9"
+PATCH_GCC_VER="13.1.0"
+MUSL_VER="1"
+MUSL_GCC_VER="13.1.0"
+
+if [[ $(ver_cut 3) == 9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=$(($(ver_cut 3) - 9998))
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$(($(ver_cut 2) - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+fi
+
+inherit toolchain
+# Needs to be after inherit (for now?), bug #830908
+EGIT_BRANCH=master
+
+# Don't keyword live ebuilds
+if ! tc_is_live && [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+# KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ KEYWORDS="~loong"
+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}-PR109469-SLP-returns-twice.patch
+ eapply "${FILESDIR}"/${P}-PR109434-DSE-throw.patch
+ eapply_user
+}