summaryrefslogtreecommitdiff
path: root/sys-devel/gcc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-04-14 05:44:50 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-04-14 05:44:50 +0100
commit1d18b53ed419c49eb3f71637ccd58a431c1368d4 (patch)
treeeb3671b1209855aa64534ee96262d06bcda99d74 /sys-devel/gcc
parentfdca6388cf31827202fae75cae067c695bd09339 (diff)
gentoo auto-resync : 14:04:2023 - 05:44:49
Diffstat (limited to 'sys-devel/gcc')
-rw-r--r--sys-devel/gcc/Manifest4
-rw-r--r--sys-devel/gcc/files/gcc-13.0.1_pre20230326-76_all_all_PR109265_PR109274_PR109325_range_def_chain.patch219
-rw-r--r--sys-devel/gcc/files/gcc-13.0.1_pre20230402-PR109304-ICE-python3.12.patch72
-rw-r--r--sys-devel/gcc/gcc-10.4.1_p20230413.ebuild58
4 files changed, 60 insertions, 293 deletions
diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
index dea462e3ffde..fea6921c28fc 100644
--- a/sys-devel/gcc/Manifest
+++ b/sys-devel/gcc/Manifest
@@ -1,5 +1,3 @@
-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-PR109462-clang-LocalizationChecker-ranger-any-PHI.patch 2018 BLAKE2B e747b0a2b8bbdcaef70f6cbda472158b1c66d88db91a05ecb22b50706c54af7842aed7a6a8057ac9b96a85cb7534cc47bae78a5a2090028b4d9c35b38188a89c SHA512 40d2500819c4c665ea75eef26ab4098cb0eef910e1a34646fb63d862eec9870216de2c8690f48f14ed918c232aed9c0112047b37ddb5efaaaa589b19565a8b19
AUX gcc-13.0.1_pre20230409-PR109469-SLP-returns-twice.patch 1930 BLAKE2B e5c5465b88a1b00afe3c85d1e4775b4fc1f19667d7e5c3e74a944fd9150d15f804b783d0f0696f0af8957368d270bc4b032a920fbff51eea09c34008e1dfc692 SHA512 0f9f6b1e94300f6351c608b09b649bdde283f84a0b4b1c5f81393075367c05a2b9986bf8bfabb560392ecd70275de9bd8230e6fbfd8af523c489f094361b9137
@@ -9,6 +7,7 @@ AUX gcc-configure-texinfo.patch 341 BLAKE2B d2ea3b2ea08f5d3a498ba27d0fb95e325097
DIST gcc-10-20230119.tar.xz 72112952 BLAKE2B 6e28cba9f6ff5c9f9231828bb400c82b8658a4f9c0166c28a6a12d71728d4460904152a8c84bbeff88c06b7f9378937b7b61bf4a871a10c56bd005170dc5fde2 SHA512 6cbb567ef1da1b6fa65892b6e71c3b7cd37e0c483e049720ea1987d444a0e7b4eb15d1e99f4e35995acdce560a811a779574eeba52bb252c61325accedd6a5c5
DIST gcc-10-20230302.tar.xz 72112120 BLAKE2B 8647639d9c6aef31b63566b006bb2980ca974e4aac4f5ced5f12a4f7fe0e9bda1e456d31f13dc478ab187d5e739ac850dd7dcc9db421ece1cadc50c952dbbed4 SHA512 97f72699b1a38de0dfb95253dc1602400fb05c2466b3682e51a4793d17db62e1d55b8d19211c3326e5369aace2a74345059b4b1c1a61a1f2c1c75a0aa9ec3e0e
DIST gcc-10-20230406.tar.xz 72168084 BLAKE2B cb74cf7bf68c4f09ae47839c41b5434e1748eeeb5fd3e6f4ea3ca051393174954f7cabaceec0009ae144bc4e5e9d823051256c71fa75e1ccdce91e20a9c6d7de SHA512 04a84c632abae00560836bb2aa3ccac6c9f674eea7dc298171e3c38cece31a38f557d571783b3a4ef94351094b173aad9390603ecb969e8f4d713c44d126a3bd
+DIST gcc-10-20230413.tar.xz 72123372 BLAKE2B fe2c92692eedd66b9a6ed6af0c9102e4bcf996bfb20b5e1bf6ab2aaaa5662dbe81d1a5a18cce2cc7dbc4e6b4b599c59ea1a9e46586a36439d5047584a876e924 SHA512 c0fdb0a083b833ed24b85f744a18b1071bcf76de620ea7eb7b20b6b59f6489596c8e6cbd4c39d7f87119421f345a788a285f7aac47eab5f01ffb3aefc1d36dba
DIST gcc-10.4.0-musl-patches-1.tar.xz 3808 BLAKE2B 804d1fcc451dcd03be71240dd498ec2d179869571d44012967c48dccf5a478dd8c55000a964a80fdd5584d739a777dee1c83241cffce514ef002df2572854a67 SHA512 83e4a9c0f7062baf0c606a2bcc56a818494991403d7577dea65f04bbc25bdb786a5889b80d45d80e7f4be07c1aef786802cbfcfafd1a17ec255a2d4e93a77570
DIST gcc-10.4.0-patches-5.tar.xz 17056 BLAKE2B f336d69a8ad105b8c4a84e8248a5b8a88175d3f1d67d32c6bee1780d252d86947059bd624992e6292610e86c9012f4d901a1a54df0d184dd023d404a0707700e SHA512 aa8fb42f20587f8519e7b06037da4d8f7d386b63e228b239a0445a51df4e401940fcd81482381d966622054aef3e0db06d1def5c74ac3d3dcc9c75c3b966c758
DIST gcc-10.4.0.tar.xz 75018092 BLAKE2B ec1169025d3896b70ab80a4b8ce5040763a95529fc7e120c6bc3a3eb1db5cf938ebde347c1e595a8ff7d4081e79ded6252702d7a1a09648449b7a0783188e434 SHA512 440c08ca746da450d9a1b35e8fd2305cb27e7e6987cd9d0f7d375f3b1fc9e4b0bd7acb3cd7bf795e72fcbead59cdef5b6c152862f5d35cd9fbfe6902101ce648
@@ -43,6 +42,7 @@ EBUILD gcc-10.4.0.ebuild 1445 BLAKE2B 05518ec2cdf0180f4db63dcab413097ca777381b49
EBUILD gcc-10.4.1_p20230119-r1.ebuild 1445 BLAKE2B 3ec47f604ac04dc3b07b02b56a912d5ca1971460b72f2adfdf3992c6d17182e7be9c7a11f047a59be29ead76b8c543d873e6c68cfd6cdea8fa6c0279f58c767d SHA512 3ec35f5053c21c1c6debc11a5b654bd5ec6c04f8bb72dd3dede77c4fab9d0734a0b866aba34d2286ef7b7ff1efa06189c7a6f79c8a57ce734c932fa6f1367b15
EBUILD gcc-10.4.1_p20230302.ebuild 1453 BLAKE2B fe070759433bfc4d214d0d14eb8998d78830420b5008d5dd7a4dc2acb5db1f3ce549a3558b884fb474831eff097ad4a0c8f7366730bda54c9ffefcc0772fbcee SHA512 2f4e1da8d8aacb17cab60fc1d215e06d72968dadb81808e9cbe2d2e80c7a0e5ef426e6bfb6d847898d7dede47dc6a715c299bf6dbca24e93bb4574437c88a632
EBUILD gcc-10.4.1_p20230406.ebuild 1456 BLAKE2B 44855d5d880bb6391a140d4212b9c92c3a0e056622380e830104aaa2146d6c1fce51690c526b1e45a7a94833c2efef6de3781567cbf0e4c1182e9de28a9bd853 SHA512 0bf4a44a5cc89f6f04ed129a24dc8b9fed0c4211fee0ff2e9e343b04e71432b053acd022374dae96096cbd65c5e9f05f7b65919a6597c85b0295f5aa1b01903e
+EBUILD gcc-10.4.1_p20230413.ebuild 1456 BLAKE2B 44855d5d880bb6391a140d4212b9c92c3a0e056622380e830104aaa2146d6c1fce51690c526b1e45a7a94833c2efef6de3781567cbf0e4c1182e9de28a9bd853 SHA512 0bf4a44a5cc89f6f04ed129a24dc8b9fed0c4211fee0ff2e9e343b04e71432b053acd022374dae96096cbd65c5e9f05f7b65919a6597c85b0295f5aa1b01903e
EBUILD gcc-10.5.9999.ebuild 1108 BLAKE2B 2db612df53fbaec59c707acb56bac804a4ee797d156ea3dfca6396d27268385f1d5177c44bd58a926c981ab1c0c7b7adf5e4ea060a65a9e84e7f8ed1713701b0 SHA512 5193d1f4359ef8963645d25150731ab1929801eae16e94ddef3fb0169ed365d2ac43765a2d4848966508144e121b8b24feccbe66f59ee9363764d5a3db79f946
EBUILD gcc-11.3.1_p20221209.ebuild 1334 BLAKE2B ca826cedb1606019ec76b0d4117f74d5847f9b575d4f73caeeb749ea93bf5c4eb5d88ae63fe18ddb3a43b6aa053fe237a3908d62e151bf099bc158f29308a3c2 SHA512 fa51e2c6bf5c691d4acc2700ecb6e16ee2a0f8706eeb404a2bfbfdc7aa2d987344ff64255827ccf32fc34540f618dbfe8fe0909d0914ec8eef6be62ac343d73c
EBUILD gcc-11.3.1_p20230120-r1.ebuild 1334 BLAKE2B ff7ec5997af15e5cc40d4834d779512c6319387f7d9b8905323db1b8d68f70e8a717817265d431ea37e259d506eeb0966472c7c4341eb76e5a1f25c4d7df9f2d SHA512 10054ca3c00ca54ec905a7d087d5d99a7db43af9bad0bff1ea1dc547e0ac899e5cddaa939a8ed4b38aad4eb109cc88fa71a6b05ea2c72a982774abb4350ecf1c
diff --git a/sys-devel/gcc/files/gcc-13.0.1_pre20230326-76_all_all_PR109265_PR109274_PR109325_range_def_chain.patch b/sys-devel/gcc/files/gcc-13.0.1_pre20230326-76_all_all_PR109265_PR109274_PR109325_range_def_chain.patch
deleted file mode 100644
index bd66ce422cff..000000000000
--- a/sys-devel/gcc/files/gcc-13.0.1_pre20230326-76_all_all_PR109265_PR109274_PR109325_range_def_chain.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109265
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109274
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109325
-https://bugs.gentoo.org/903505
-https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=dd63bba0c8dc3a6ae06cfdc084bca7c68b8bbd39
-
-From dd63bba0c8dc3a6ae06cfdc084bca7c68b8bbd39 Mon Sep 17 00:00:00 2001
-From: Andrew MacLeod <amacleod@redhat.com>
-Date: Fri, 24 Mar 2023 11:21:20 -0400
-Subject: [PATCH] Fix compute_operand when op1 == op2 symbolically.
-
-First, class value_relation should not sanitize records. just create
-what is asked.
-
-Second., if there is not a relation record, compute_operand was
-creating one for op1 == op2 if op1 and op2 were the same symbol. This
-is not the correct way to communicate the information, as that record
-will continue to be passed along the GORI unwind chain.
-
-Instead, simply pass that information locally to the opX_range routine
-for only the current statement.
-
- PR tree-optimization/109265
- PR tree-optimization/109274
- gcc/
- * gimple-range-gori.cc (gori_compute::compute_operand_range): Do
- not create a relation record is op1 and op2 are the same symbol.
- (gori_compute::compute_operand1_range): Pass op1 == op2 to the
- handler for this stmt, but create a new record only if this statement
- generates a relation based on the ranges.
- (gori_compute::compute_operand2_range): Ditto.
- * value-relation.h (value_relation::set_relation): Always create the
- record that is requested.
-
- gcc/testsuite/
- * gcc.dg/pr109274.c: New.
- * gfortran.dg/pr109265.f90: New.
---- a/gcc/gimple-range-gori.cc
-+++ b/gcc/gimple-range-gori.cc
-@@ -623,21 +623,6 @@ gori_compute::compute_operand_range (vrange &r, gimple *stmt,
- tree op1 = gimple_range_ssa_p (handler.operand1 ());
- tree op2 = gimple_range_ssa_p (handler.operand2 ());
-
-- // If there is a relation, use it instead of any passed in. This will allow
-- // multiple relations to be processed in compound logicals.
-- if (op1 && op2)
-- {
-- relation_kind k = handler.op1_op2_relation (lhs);
-- // If there is no relation, and op1 == op2, create a relation.
-- if (!vrel_ptr && k == VREL_VARYING && op1 == op2)
-- k = VREL_EQ;
-- if (k != VREL_VARYING)
-- {
-- vrel.set_relation (k, op1, op2);
-- vrel_ptr = &vrel;
-- }
-- }
--
- // Handle end of lookup first.
- if (op1 == name)
- return compute_operand1_range (r, handler, lhs, name, src, vrel_ptr);
-@@ -1093,6 +1078,7 @@ gori_compute::compute_operand1_range (vrange &r,
- const vrange &lhs, tree name,
- fur_source &src, value_relation *rel)
- {
-+ value_relation local_rel;
- gimple *stmt = handler.stmt ();
- tree op1 = handler.operand1 ();
- tree op2 = handler.operand2 ();
-@@ -1101,6 +1087,7 @@ gori_compute::compute_operand1_range (vrange &r,
- relation_trio trio;
- if (rel)
- trio = rel->create_trio (lhs_name, op1, op2);
-+ relation_kind op_op = trio.op1_op2 ();
-
- Value_Range op1_range (TREE_TYPE (op1));
- Value_Range tmp (TREE_TYPE (op1));
-@@ -1113,10 +1100,26 @@ gori_compute::compute_operand1_range (vrange &r,
- if (op2)
- {
- src.get_operand (op2_range, op2);
-- relation_kind op_op = trio.op1_op2 ();
-+
-+ // If there is a relation betwen op1 and op2, use it instead.
-+ // This allows multiple relations to be processed in compound logicals.
-+ if (gimple_range_ssa_p (op1) && gimple_range_ssa_p (op2))
-+ {
-+ relation_kind k = handler.op1_op2_relation (lhs);
-+ if (k != VREL_VARYING)
-+ {
-+ op_op = k;
-+ local_rel.set_relation (op_op, op1, op2);
-+ rel = &local_rel;
-+ }
-+ }
-+
- if (op_op != VREL_VARYING)
- refine_using_relation (op1, op1_range, op2, op2_range, src, op_op);
-
-+ // If op1 == op2, create a new trio for just this call.
-+ if (op1 == op2 && gimple_range_ssa_p (op1))
-+ trio = relation_trio (trio.lhs_op1 (), trio.lhs_op2 (), VREL_EQ);
- if (!handler.calc_op1 (tmp, lhs, op2_range, trio))
- return false;
- }
-@@ -1185,6 +1188,7 @@ gori_compute::compute_operand2_range (vrange &r,
- const vrange &lhs, tree name,
- fur_source &src, value_relation *rel)
- {
-+ value_relation local_rel;
- gimple *stmt = handler.stmt ();
- tree op1 = handler.operand1 ();
- tree op2 = handler.operand2 ();
-@@ -1201,9 +1205,26 @@ gori_compute::compute_operand2_range (vrange &r,
- if (rel)
- trio = rel->create_trio (lhs_name, op1, op2);
- relation_kind op_op = trio.op1_op2 ();
-+
-+ // If there is a relation betwen op1 and op2, use it instead.
-+ // This allows multiple relations to be processed in compound logicals.
-+ if (gimple_range_ssa_p (op1) && gimple_range_ssa_p (op2))
-+ {
-+ relation_kind k = handler.op1_op2_relation (lhs);
-+ if (k != VREL_VARYING)
-+ {
-+ op_op = k;
-+ local_rel.set_relation (op_op, op1, op2);
-+ rel = &local_rel;
-+ }
-+ }
-+
- if (op_op != VREL_VARYING)
- refine_using_relation (op1, op1_range, op2, op2_range, src, op_op);
-
-+ // If op1 == op2, create a new trio for this stmt.
-+ if (op1 == op2 && gimple_range_ssa_p (op1))
-+ trio = relation_trio (trio.lhs_op1 (), trio.lhs_op2 (), VREL_EQ);
- // Intersect with range for op2 based on lhs and op1.
- if (!handler.calc_op2 (tmp, lhs, op1_range, trio))
- return false;
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/pr109274.c
-@@ -0,0 +1,16 @@
-+/* PR tree-optimization/109274 */
-+/* { dg-do compile } */
-+/* { dg-options "-O2 " } */
-+
-+float a, b, c;
-+int d;
-+float bar (void);
-+
-+void
-+foo (void)
-+{
-+ a = 0 * -(2.0f * c);
-+ d = a != a ? 0 : bar ();
-+ b = c;
-+}
-+
---- /dev/null
-+++ b/gcc/testsuite/gfortran.dg/pr109265.f90
-@@ -0,0 +1,39 @@
-+! PR tree-optimization/109265
-+! { dg-do compile }
-+! { dg-options "-O3 -w" }
-+
-+module pr109265
-+ integer, parameter :: r8 = selected_real_kind (12)
-+contains
-+ subroutine foo (b, c, d, e, f)
-+ implicit none
-+ logical :: b
-+ real (kind = r8) :: c, d, e, f, i
-+ if (b) then
-+ c = bar (c * d, e)
-+ i = bar (f, c)
-+ call baz (i)
-+ call baz (-i)
-+ end if
-+ end subroutine foo
-+ function bar (a, b)
-+ implicit none
-+ real (kind = r8) :: bar
-+ real (kind = r8) :: a, b
-+ bar = a + b
-+ end function bar
-+ subroutine baz (b)
-+ implicit none
-+ real (kind = r8) :: b, d, e, f, g, h, i
-+ d = b
-+ i = 0
-+ e = d
-+ f = d
-+ g = d
-+ 10 continue
-+ if ((e.eq.d) .and. (f.eq.d) .and. (g.eq.d) .and. (h.eq.d)) then
-+ h = i
-+ goto 10
-+ end if
-+ end subroutine baz
-+end module pr109265
---- a/gcc/value-relation.h
-+++ b/gcc/value-relation.h
-@@ -445,13 +445,6 @@ value_relation::set_relation (relation_kind r, tree n1, tree n2)
- {
- gcc_checking_assert (TREE_CODE (n1) == SSA_NAME
- && TREE_CODE (n2) == SSA_NAME);
-- if (n1 == n2 && r != VREL_EQ)
-- {
-- related = VREL_VARYING;
-- name1 = NULL_TREE;
-- name2 = NULL_TREE;
-- return;
-- }
- related = r;
- name1 = n1;
- name2 = n2;
---
-2.31.1
diff --git a/sys-devel/gcc/files/gcc-13.0.1_pre20230402-PR109304-ICE-python3.12.patch b/sys-devel/gcc/files/gcc-13.0.1_pre20230402-PR109304-ICE-python3.12.patch
deleted file mode 100644
index 8b6baea37b70..000000000000
--- a/sys-devel/gcc/files/gcc-13.0.1_pre20230402-PR109304-ICE-python3.12.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-https://bugs.gentoo.org/903245
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109304
-https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=d0b961b802dd7d9d555ff4515835a479329326e9
-
-From d0b961b802dd7d9d555ff4515835a479329326e9 Mon Sep 17 00:00:00 2001
-From: Richard Biener <rguenther@suse.de>
-Date: Tue, 28 Mar 2023 08:06:12 +0000
-Subject: [PATCH] tree-optimization/109304 - properly handle instrumented
- aliases
-
-When adjusting calls to reflect instrumentation we failed to handle
-calls to aliases since they appear to have no body. Instead resort
-to symtab node availability. The patch also avoids touching
-internal function calls in a more obvious way (builtins might
-have a body available).
-
-profiledbootstrap & regtest running on x86_64-unknown-linux-gnu.
-
-Honza - does this look OK?
-
- PR tree-optimization/109304
- * tree-profile.cc (tree_profiling): Use symtab node
- availability to decide whether to skip adjusting calls.
- Do not adjust calls to internal functions.
-
- * gcc.dg/pr109304.c: New testcase.
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/pr109304.c
-@@ -0,0 +1,12 @@
-+/* { dg-do compile } */
-+/* { dg-require-profiling "-fprofile-generate" } */
-+/* { dg-require-effective-target fpic } */
-+/* { dg-options "-O3 -fprofile-generate -fPIC -fno-semantic-interposition" } */
-+
-+int PyUnicode_FindChar_i;
-+int PyUnicode_FindChar()
-+{
-+ while (PyUnicode_FindChar_i)
-+ if (PyUnicode_FindChar())
-+ break;
-+}
---- a/gcc/tree-profile.cc
-+++ b/gcc/tree-profile.cc
-@@ -808,7 +808,7 @@ tree_profiling (void)
- {
- if (!gimple_has_body_p (node->decl)
- || !(!node->clone_of
-- || node->decl != node->clone_of->decl))
-+ || node->decl != node->clone_of->decl))
- continue;
-
- /* Don't profile functions produced for builtin stuff. */
-@@ -842,12 +842,15 @@ tree_profiling (void)
- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- {
- gcall *call = dyn_cast <gcall *> (gsi_stmt (gsi));
-- if (!call)
-+ if (!call || gimple_call_internal_p (call))
- continue;
-
- /* We do not clear pure/const on decls without body. */
- tree fndecl = gimple_call_fndecl (call);
-- if (fndecl && !gimple_has_body_p (fndecl))
-+ cgraph_node *callee;
-+ if (fndecl
-+ && (callee = cgraph_node::get (fndecl))
-+ && callee->get_availability (node) == AVAIL_NOT_AVAILABLE)
- continue;
-
- /* Drop the const attribute from the call type (the pure
---
-2.31.1
diff --git a/sys-devel/gcc/gcc-10.4.1_p20230413.ebuild b/sys-devel/gcc/gcc-10.4.1_p20230413.ebuild
new file mode 100644
index 000000000000..07a2b5e91ab4
--- /dev/null
+++ b/sys-devel/gcc/gcc-10.4.1_p20230413.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_SUFFIX="xz"
+TOOLCHAIN_PATCH_DEV="sam"
+#TOOLCHAIN_GCC_RC=1
+PATCH_GCC_VER="10.5.0"
+PATCH_VER="5"
+MUSL_VER="2"
+MUSL_GCC_VER="10.5.0"
+
+if [[ $(ver_cut 3) == 9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=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}.$(($(ver_cut 3) - 9998))
+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="https://gcc.gnu.org/pub/gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+# Needs to be after inherit (for now?), bug #830908
+EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+
+# Don't keyword live ebuilds
+#if ! tc_is_live && [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+# KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+#fi
+
+RDEPEND=""
+BDEPEND="${CATEGORY}/binutils"
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ if has_version '>=sys-libs/glibc-2.32-r1'; then
+ rm -v "${WORKDIR}/patch/23_all_disable-riscv32-ABIs.patch" || die
+ fi
+
+ toolchain_src_prepare
+}