summaryrefslogtreecommitdiff
path: root/sys-devel
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/Manifest.gzbin6226 -> 6229 bytes
-rw-r--r--sys-devel/gcc/Manifest8
-rw-r--r--sys-devel/gcc/files/gcc-15.0.1_pre20250209-coro.patch124
-rw-r--r--sys-devel/gcc/files/gcc-15.0.1_pre20250209-range-for-mariadb.patch530
-rw-r--r--sys-devel/gcc/gcc-12.4.1_p20250213.ebuild65
-rw-r--r--sys-devel/gcc/gcc-13.3.1_p20250214.ebuild66
-rw-r--r--sys-devel/gcc/gcc-15.0.1_pre20250209-r1.ebuild (renamed from sys-devel/gcc/gcc-15.0.1_pre20250209.ebuild)2
7 files changed, 794 insertions, 1 deletions
diff --git a/sys-devel/Manifest.gz b/sys-devel/Manifest.gz
index 7472ab05e6ea..91cb947633a3 100644
--- a/sys-devel/Manifest.gz
+++ b/sys-devel/Manifest.gz
Binary files differ
diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
index 334b154a047a..f5c02871d826 100644
--- a/sys-devel/gcc/Manifest
+++ b/sys-devel/gcc/Manifest
@@ -1,5 +1,7 @@
AUX gcc-13-fix-cross-fixincludes.patch 883 BLAKE2B 1ae33195320754c55f42e1206bcfdf98914af5190df5939a4c7b072a2bc25216c354ea5d76f5171e1b8a150ca7764bdf57cea1bc137c237a5e8bb44713885f1b SHA512 ca9625001f0a10826d75691fdba35ca5783ed2f80e605b935785f8dc7591b0e650dca28bf1fc7e688e27547dddc7ab38232459b4f1865ed10a148978d0e09703
AUX gcc-14.2.1_p20241221-arm-Revert-arm-MVE-intrinsics-Fix-support-for-predicate-.patch 5160 BLAKE2B f229bc58851d348a67d636d65878166479f2eb735dddc6368e21c2cc5b1c2b8660b1c87024c1637a25a9acf609662823337307f21fe9a51fe9cbfc6fdcbb0a16 SHA512 c62e991b826cee7258abfa3f1305fc33b8b0e0dce2aaa1ae5a753b547126d9dde6632894eb72e46c6c78c9777029a7593a4f9afbb6a3ac6d831c63ea0c19decd
+AUX gcc-15.0.1_pre20250209-coro.patch 4896 BLAKE2B eae3946f14282e47014f005e10f4e29c8724d083f4f2fb8a93fa005e1c27c51a950d32b4f20e1483041c39a7bf2f923e0f636000d2be159474257e6642c82df0 SHA512 f5309eb07e1fdcd4ebfbdc14296290581b5c0b4d702bbb607fdedf2076317bc68b0d2eca715b6d6499e1c1cda95853e56cc21d2c1be77979d9e3c01f845dbc1f
+AUX gcc-15.0.1_pre20250209-range-for-mariadb.patch 21382 BLAKE2B 2859d2210810bf56c5e93eefad2b95c087cb7cecc376f44ab931a5860c0c9088fb664edd7acaf7dbe6a0da52c1f81e74d9b95f5651c7e69f1470244f9983e4ea SHA512 65dd19373cedcf27f0d7d5ddfe5584317f9b823798bcac54a66724c12434207fe73ccef12c6800a930de6902372fb7ada61806afd8b9673970e51acb55387136
AUX gcc-configure-texinfo.patch 341 BLAKE2B d2ea3b2ea08f5d3a498ba27d0fb95e325097e2104e55caa28b66515cb48662649140d90b639369aedc54b2b1178fa4b49cda442f5f504e09d88a2efa45a5057c SHA512 e8d34c5077409df5495cf0c5fbf5e77f841c5698108fa6a5fde33eb28202c685603bdefd8368918e55f30c4b995e895d71d64c715c1ec2b017e09eb2c54c09ff
DIST gcc-10.5.0-musl-patches-2.tar.xz 3452 BLAKE2B 5387e516d07d81477b3f39b8b3bd986bf861d32cd25dc5481c97bd3620d00c918c5661e86857f66dbf28a655401a53e43417f638c443e44cbfdbf5e950caac4d SHA512 86f2ce31cc4fc4fb5a6043fb527bf822d895e1a6220652024f78a1cbd5a962edb6be8dc5f43c32053e075f39bb2350ea8f14e7d57e0473dd2933a7b44676bde5
DIST gcc-10.5.0-patches-6.tar.xz 18208 BLAKE2B 4cac3340108fb378c76ad62b728429f3c97f348d178744e7536575f3576ca8aa682b878b7df3b1c162dccae64a3cb56c66d8d60eae323e1ece2de4278084fdbd SHA512 9d6c84325fbc118cee01347468ce729c278e5b026b16da945fe54050726e26f86a46ee7b71a01a47cf927b70bfcce459c49a6bc4fb93dcfaa047c76d4c5bc5bc
@@ -12,6 +14,7 @@ DIST gcc-12-20250116.tar.xz 79921816 BLAKE2B b4c2ee7fb76b15834b5637d157c39cbdedc
DIST gcc-12-20250123.tar.xz 79912136 BLAKE2B f143da3aaa36020b99c0da4b4951743f90fcbcdf93af325bd76878944187005e80b11657b85ab0cf014434acf5431a45cb29effb9a8e3922092ec5dee6606b51 SHA512 1b9dba666d9538171f935334c5a7106499758f26422a497c748c4ea90983e77bfaaecdb8a96099e1a43c0722e15d34a3c0f549e531cb56ea3a990e71f0b2135b
DIST gcc-12-20250130.tar.xz 79936036 BLAKE2B ceca895f319d4d97e1d936c8caad24b847d95aba24270c5489dda55ed0a2f69f6da58b34705af7ccedd002567e6dba52f91e82a4b79d646e7a885057267838fe SHA512 043ca62adc0d7dc9a3021dc288c2483c0baf4e18b7f155944e79d6b95b4c8efe3ac694ddc8d7ab12d715a9313dd0a5f9fe7271002a497ad0ecdf9e9451f95073
DIST gcc-12-20250206.tar.xz 79919852 BLAKE2B b20f3c61d9f25a78bb3b60243d523552d36728353e75c77cf71831685f83fdc539c5ea52244a41deabe64e4158a62d852478e261be82cc97b4c28e6393d842ac SHA512 34692ec6575ab526123f697888bfa8b48103a3416a82562e292adc845db31adf3eb76179625627b908ed129c893f200657537e3a33ad7f2619b635f285171d64
+DIST gcc-12-20250213.tar.xz 79923504 BLAKE2B 0ccfcb0bb5b7ccedc54964c5be0d8eec1cc9ea8e43714cc203bcfd5de16b5725a66727096ade8ab29316e6320466d2b99a82750aa3ac68a7c1b9651958f25b67 SHA512 9914d5a6cb0eb608e321ba4f5da6201c12083e5d2a58ff59875f37d5b0f34ad9324f9150ad27ec85b8e0e56983eff3973653ceb4a0011afdc1489efb044a5a06
DIST gcc-12.4.0-musl-patches-1.tar.xz 3068 BLAKE2B e5e39c24934072ea89e4467d0dc5196f3dadfb5ffba0c856d051648a2fbf57d434a57e95227cdf2b8cea45f0f5555aec2bc372d2f6cb0b69efd87831d248d364 SHA512 b9db204845a25be043d76cae826d42eebeeb4f9be7c3049af6fe7601a552bedfd24731156a6a36b4b5e2e2af656a589a5c556d2b0b3ded33ba290a773ee87c62
DIST gcc-12.4.0-patches-1.tar.xz 15576 BLAKE2B 98c29888de7701b365be7ac9062f0cee3340d58c85485e26f0d02f1483ec64cc9c10651488a4fd937551afe30f4e19777e6766871a724ae3ba6c290c16f4fdf1 SHA512 3f7c5d36e56e07ea9dd143a5d13342a6c1ccbf0643abd1c0bcbfb46bb7c7b1308aef6e3e882031c9c191610f01af906b19be5aa2b139cf617614f46e97463aec
DIST gcc-12.4.0-patches-2.tar.xz 14876 BLAKE2B 6bf5abbb2abba4b9fe9fa153ac4112fe5f563e97cd4e1b885ccd0d88abf1124fa91f20d6be972e2242410447be73bca60014785f8551b8087ed0d4cc3e868225 SHA512 dfd5f02d4c1076fad4ee998b2f620171dd3eb65a1160312def9dae89b18327a06db853f569e0e3c049e5ab06c61488bb6faecec52bafe737fddeb43628c54a1f
@@ -21,6 +24,7 @@ DIST gcc-13-20250117.tar.xz 84520416 BLAKE2B 3ce98ce1a17ec5a733e3cb8eab0a6084d5e
DIST gcc-13-20250124.tar.xz 84528596 BLAKE2B db8c45b1babd48158644899fe1a3e263eee6e716bc117be95f53aa30e00bf4a87b6de7c852e558887001cea53fbaaea4fe176f8a2361cf122cd05c36c7a0ae8f SHA512 d5d32c66d22a1fb2fca1db1c473125003ef204c68711459eb358374259efb924ea160c363b7b1c81659cc6bf154de499949c02e9adde1ddb4dcb2f2ebbb27e42
DIST gcc-13-20250131.tar.xz 84530144 BLAKE2B 45a667a31abd556383009d64ab9860ce2815c2446db02b985ec295344aed40060f8e90a01cea907082fdfc25a4572e0baf3fea9739b8777c0b9f76a9eacc4a22 SHA512 909fd58368f379863580e3641b0404e187293db5b3a88c703231726d8aced1241578d5865dcc1c62fcbe3ce030f24e433ff75bfff8266801d829998cab6abb01
DIST gcc-13-20250207.tar.xz 84528380 BLAKE2B da70e92437a364ae75c83199c3d1d075d73d5e3a9d78159633736f15a483771f352d3628c0f99de727790197f60fe9ad40a25d106b6a646a703e72599c419244 SHA512 c99701b181903169ed664e3b53b1f8c84f894b047ff9da0535fd02ab1160a290bbd7e34709d87f611617f24a7f44b1a348ca37d6d60ce356fe8bcb3cf78506fb
+DIST gcc-13-20250214.tar.xz 84517404 BLAKE2B 0a37019f5948e16b35b4e5952f6ec90f77a284a2f5b4367c8ac223d9fef952903ce2c5b0807d6fa574a65ecd79c5a33a97a19e3d3face14b48f3ea7a9880ab44 SHA512 f15d0d9598b0c59303660c30298415b0e6a592ce2e4f2bf77ff5c1517a15e9f8308d09421efa6425a9fcccbb5499f70c87859fc98ac41264b64b383d815fa3e4
DIST gcc-13.2.0-musl-patches-2.tar.xz 5292 BLAKE2B c057d6574d03c05854edaa9f3fd40e9149662b04f3ac7a7db3eb078d73a7b535726d1bf52e5b12736dedb2f9898ad731f2e48a6421fcfbf7b90f929dee072fcb SHA512 a691da0c87c443a5e9d23731f4005f27871c5b12bc9102873ffa24d374aa7b9fbd187c4f5635d23fa9ffb17e351e76173c2d3fdf40646e355c4cb314b538de69
DIST gcc-13.2.0-patches-3.tar.xz 30956 BLAKE2B 29ce043b46645640ca1e983397af3e158588ad87575f0bc59451ea4a7dd5e3bb5b190ed031de6a22cd790d423ba111e95d222187dd09985dceb12db9f0a2d907 SHA512 4ffecae7be320124ad0c4e71e39e142b7aa8db0e70b5f486f491d7a33ea31efc6464c6abeea77df02a8bd5cf81f08225d625c8af5c27f9afa32c0d7d989f7a3c
DIST gcc-13.2.0.tar.xz 87858592 BLAKE2B 0034b29d3d6cc05821f0c4253ce077805943aff7b370729dd203bda57d89c107edd657eeddc2fb1e69ea15c7b0323b961f46516c7f4af89a3ccf7fea84701be2 SHA512 d99e4826a70db04504467e349e9fbaedaa5870766cda7c5cab50cdebedc4be755ebca5b789e1232a34a20be1a0b60097de9280efe47bdb71c73251e30b0862a2
@@ -57,6 +61,7 @@ EBUILD gcc-12.4.1_p20250116.ebuild 1624 BLAKE2B f4a16d6af11158666ec0ad9ced5841c8
EBUILD gcc-12.4.1_p20250123.ebuild 1624 BLAKE2B f4a16d6af11158666ec0ad9ced5841c89b6ce70964950b3c439105b240a3534b633dca7bf97aaef847b222f8aa323f815fa7410b5f4b115f07f50f4ff1cd31db SHA512 30bc2e09a28caf65eccc0e2f496d5095d2735e5e118b269d2cfad638c8874283ce364a14074d63c4e43862e247cc0626364c7f19ab3ac314250a5e52360331fc
EBUILD gcc-12.4.1_p20250130.ebuild 1624 BLAKE2B f4a16d6af11158666ec0ad9ced5841c89b6ce70964950b3c439105b240a3534b633dca7bf97aaef847b222f8aa323f815fa7410b5f4b115f07f50f4ff1cd31db SHA512 30bc2e09a28caf65eccc0e2f496d5095d2735e5e118b269d2cfad638c8874283ce364a14074d63c4e43862e247cc0626364c7f19ab3ac314250a5e52360331fc
EBUILD gcc-12.4.1_p20250206.ebuild 1624 BLAKE2B f4a16d6af11158666ec0ad9ced5841c89b6ce70964950b3c439105b240a3534b633dca7bf97aaef847b222f8aa323f815fa7410b5f4b115f07f50f4ff1cd31db SHA512 30bc2e09a28caf65eccc0e2f496d5095d2735e5e118b269d2cfad638c8874283ce364a14074d63c4e43862e247cc0626364c7f19ab3ac314250a5e52360331fc
+EBUILD gcc-12.4.1_p20250213.ebuild 1624 BLAKE2B f4a16d6af11158666ec0ad9ced5841c89b6ce70964950b3c439105b240a3534b633dca7bf97aaef847b222f8aa323f815fa7410b5f4b115f07f50f4ff1cd31db SHA512 30bc2e09a28caf65eccc0e2f496d5095d2735e5e118b269d2cfad638c8874283ce364a14074d63c4e43862e247cc0626364c7f19ab3ac314250a5e52360331fc
EBUILD gcc-12.5.9999.ebuild 1592 BLAKE2B 287d83b5979c9cf974e890e5835bab37fa34a97dfc8fd473d1344e9896835a2980c885e7584649ebaede68b06dcf5cdbbc0f768aa1fa6c1603d3b0135a93d170 SHA512 025fa1a7803303e99c2186bc2eb2e69e9cd5401f787aa4eac2f0ad709558142130adff6fb75e610d2b9acf9ea7775540e4b249ecbd348d30167a04108e97d523
EBUILD gcc-13.2.0.ebuild 1682 BLAKE2B 5a19639504afafced19bd1ad913e3106a65d16b4b3d5aeabedb0cbc891bdac22d9cd0a21928eef51b88dcbbe64927fabe8fc9bf0fe19ea755ad5959bf5acfb67 SHA512 3865dff4bb19f022f6a1a2d653bc8f7eab9c47e99ec5b30e4600506faab301f410ff26f1155b5305f219f3b89f344cc8271aef8b6d6fb2568e8937d5867ea843
EBUILD gcc-13.3.1_p20241220.ebuild 1674 BLAKE2B f259931c9581507f6140ee400ddab4bb7f0889a6eefdf2f7f72430cf34c487f0aa0cde5b3bbe13b513331e3f656078c5033f3540b8873de949d3225b2f584976 SHA512 865c309f411438db3b85ee5cdc93025e4ae7808236d382057c4d0c40a03850555d559357168f2928c174660fbe7a4aa530fb055af90ad5f086af7f46c9654029
@@ -64,6 +69,7 @@ EBUILD gcc-13.3.1_p20250117.ebuild 1683 BLAKE2B 206ccd1583bf86e8facebad527f8deb2
EBUILD gcc-13.3.1_p20250124.ebuild 1683 BLAKE2B 206ccd1583bf86e8facebad527f8deb2aa0c804bb3db379016e8bcc60319a42647510c0e27b1fd622121721877346d07565d15878c5bdd7ea6ef4bf8473f9db3 SHA512 d593a33b2b28477201788954afc6c307e8ad9d1d720cf4de273742c441e43894516ae8c57756dca8cd504c2a1da021aeb2a403bacbf8870ea9d9f8e823373c9f
EBUILD gcc-13.3.1_p20250131.ebuild 1683 BLAKE2B 206ccd1583bf86e8facebad527f8deb2aa0c804bb3db379016e8bcc60319a42647510c0e27b1fd622121721877346d07565d15878c5bdd7ea6ef4bf8473f9db3 SHA512 d593a33b2b28477201788954afc6c307e8ad9d1d720cf4de273742c441e43894516ae8c57756dca8cd504c2a1da021aeb2a403bacbf8870ea9d9f8e823373c9f
EBUILD gcc-13.3.1_p20250207.ebuild 1683 BLAKE2B 206ccd1583bf86e8facebad527f8deb2aa0c804bb3db379016e8bcc60319a42647510c0e27b1fd622121721877346d07565d15878c5bdd7ea6ef4bf8473f9db3 SHA512 d593a33b2b28477201788954afc6c307e8ad9d1d720cf4de273742c441e43894516ae8c57756dca8cd504c2a1da021aeb2a403bacbf8870ea9d9f8e823373c9f
+EBUILD gcc-13.3.1_p20250214.ebuild 1683 BLAKE2B 206ccd1583bf86e8facebad527f8deb2aa0c804bb3db379016e8bcc60319a42647510c0e27b1fd622121721877346d07565d15878c5bdd7ea6ef4bf8473f9db3 SHA512 d593a33b2b28477201788954afc6c307e8ad9d1d720cf4de273742c441e43894516ae8c57756dca8cd504c2a1da021aeb2a403bacbf8870ea9d9f8e823373c9f
EBUILD gcc-13.4.9999.ebuild 1651 BLAKE2B 48ad06325489ff94c03e1a1584a9d92f3d624aa8c6a1bb1a55ec8818ef66a75b9acca9a3b18c2743d11b118f1643fecdd5be577f780dad86dc89f67ac095e761 SHA512 7670b8cd00501d127cfaa8ca283bf83b1b29cbe65aa3e2f956c0c3fb169a903f1ef55d298c05b833cd3a2b3e6a72c0f7a2145aca698be730e20fc1a1c406c2de
EBUILD gcc-14.2.1_p20241221.ebuild 1537 BLAKE2B c7c007768b41459ce15112d6b1847aba0793f45416979433d1416ea786c2eb93c340da86af3e78999c68bbf16cce0f67f7653587bfb549fb68cd0ba9d25dd300 SHA512 021fec1ab5cf2073a93018221caa9af35c0a2975fb9820e484a03250136edc15135ccfd2861f7815b04ea1fd1bf109bca9bd66222469c99414fecd0b5ef072be
EBUILD gcc-14.2.1_p20250118.ebuild 1440 BLAKE2B e19fede45adb75c13176dc209b4ffa6818bd0753db3dd8710327bf8402307f5e48bef65116de97b437987a0eceb153156c3996250ab240f06c68d946f29f2fd5 SHA512 d966850a6b8759390507ffe1975298975699a2272f293e69cef9173b3c252065685ded61a8870700d2dd4d420525d4813243daed279ac7836e00dab4c2cd116f
@@ -75,7 +81,7 @@ EBUILD gcc-15.0.0_pre20250112-r3.ebuild 1360 BLAKE2B 2664e6319b5295dcee40ab54f11
EBUILD gcc-15.0.1_pre20250119.ebuild 1360 BLAKE2B 87f127b63e1fc913bd57a354fb9d9a8e8628f22767793ce4a54be7f29ec5af0dd02e22103644318a32f1dcee378e3ece07cc714523d8f9955b377d8d4cb6c610 SHA512 41c9ea8e3932e365c369551c4c9649780cfa8fed2b9b682a1359e4fc8c415ae945f2e59e9d045701bec266946808ff2e486d2fa26eae30e4efe657cbd1a11659
EBUILD gcc-15.0.1_pre20250126.ebuild 1360 BLAKE2B b443a664f9fce1f359cb45a8af97255d94862013198fd9f2c659bbef3374e0911307c3b74dc4354dc68cc8c8277ee3db287d1e00514265ae3ebb372f76d5217f SHA512 c65a8406610fd429dc6d9501b39d4e43ef6151322159cf062c15f99dfd3e0494cca0fe59c132a5a9cd8ac02b4d619ac9be7cc9657c3d3f9e1d176beaa5f80cc7
EBUILD gcc-15.0.1_pre20250202.ebuild 1360 BLAKE2B 65cb041c77ca584db2ba238d1cfbc77061f1b80a7f3e27455c5a865b4f21deef0862f7dbb249fd4d9e657217f4f5690bedd1770cecb4f88b1af468c7ebd55156 SHA512 acd25dba00d02d78b0d77ac25770c2fe6e44a1947b0b3df95dd29323701cca3b98f9e2699b9d2170322a970636d77860784b52e43a82fd08e631d34804702d25
-EBUILD gcc-15.0.1_pre20250209.ebuild 1360 BLAKE2B 7f5bcb7d9a49d2a55da575f518a6c0c171c2da6c4a34f9af462cba84fc10e74f31e76f682fced385b7ad8a8800afcb7a6bcb81f96e05114b6883b715916bd48a SHA512 1fb3fb48f1439cc4aa80e022015931ab59da588694923666c1f17c73da2208b912459b7cdc4617b6fdaa0aeaaa77195e7a204c926957419d3c40e6da120c2d0f
+EBUILD gcc-15.0.1_pre20250209-r1.ebuild 1449 BLAKE2B bffb5a50982599c1c68f52576f2632fc630f6ee6677915d2a42fd6744e1ab479706b8c1a65e42dc3de728831b3c69713a50708535e41e47827c8fda973c3fec7 SHA512 67482a3d43d27edd16a3872c1605fd8bc4e58d0c84c47702cc7161f95f5cdb915ee82ac89fb40d1553456995e1fa76d371e8c90e318262ef1e2f12633b35751b
EBUILD gcc-15.0.9999.ebuild 1332 BLAKE2B 6f17f77603522bac72d4d57094cc086263a9bfe6273c04d91b169ebc23d78fa2943c0950d4a40fe846d9d92648e54ca54ad1cecd5446ed5710062f9dca569b4b SHA512 4e4a673229a36dee68238e10efb2d9e0ff1c530411395e5230bbf567c92342a4b79d0ecb0ec91573c52fd8b5efd5cf6d20e612971848c9529378e0c42c0e213d
EBUILD gcc-8.5.0-r2.ebuild 549 BLAKE2B 2856372670c76fbe54778c0532815e3510b01b1c8aad99acc3e9183bf6829251952e29887340895625c1e421e19302430ae1a0a8dddcd8470bd71cc221f0b6b0 SHA512 559ba0dbdc7542b6af5d101f19a5b3c9eab38b9996c26330834ffa924fd8c792988f223b492e6ac84255eccbc4af762be50c2d60e84ca24b7a9ebba134608c6d
EBUILD gcc-9.5.0.ebuild 1257 BLAKE2B b398cea6cb4227fd126b85feb3e735f6b505236f54aecc9983e46fd30dbfcd8f16e80680c231567212c7cbd524b0d485574f7c5c5830137f9ebeea089a641e90 SHA512 0faea0a2389563bede22ba172ae6ab490a693c221bf6700152e9f63b23fad8d74a595a50c40cdf2eed32ee5e9cdddfdb6e2907629036c94034327f5772c93f6f
diff --git a/sys-devel/gcc/files/gcc-15.0.1_pre20250209-coro.patch b/sys-devel/gcc/files/gcc-15.0.1_pre20250209-coro.patch
new file mode 100644
index 000000000000..bc51deefafe7
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-15.0.1_pre20250209-coro.patch
@@ -0,0 +1,124 @@
+https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=556248d7d2cf557423993eb68f6a55ae6bda0cee
+
+From 556248d7d2cf557423993eb68f6a55ae6bda0cee Mon Sep 17 00:00:00 2001
+From: Jason Merrill <jason@redhat.com>
+Date: Tue, 11 Feb 2025 13:51:32 +0100
+Subject: [PATCH] c++: don't default -frange-for-ext-temps in -std=gnu++20
+ [PR188574]
+
+Since -frange-for-ext-temps has been causing trouble, let's not enable it
+by default in pre-C++23 GNU modes for GCC 15, and also allow disabling it in
+C++23 and up.
+
+ PR c++/188574
+
+gcc/c-family/ChangeLog:
+
+ * c-opts.cc (c_common_post_options): Only enable
+ -frange-for-ext-temps by default in C++23.
+
+gcc/ChangeLog:
+
+ * doc/invoke.texi: Adjust -frange-for-ext-temps documentation.
+
+gcc/testsuite/ChangeLog:
+
+ * g++.dg/cpp23/range-for3.C: Use -frange-for-ext-temps.
+ * g++.dg/cpp23/range-for4.C: Adjust expected result.
+
+libgomp/ChangeLog:
+
+ * testsuite/libgomp.c++/range-for-4.C: Adjust expected result.
+---
+ gcc/c-family/c-opts.cc | 17 +++--------------
+ gcc/doc/invoke.texi | 5 ++---
+ gcc/testsuite/g++.dg/cpp23/range-for3.C | 4 ++--
+ gcc/testsuite/g++.dg/cpp23/range-for4.C | 4 ++--
+ libgomp/testsuite/libgomp.c++/range-for-4.C | 2 +-
+ 5 files changed, 10 insertions(+), 22 deletions(-)
+
+diff --git a/gcc/c-family/c-opts.cc b/gcc/c-family/c-opts.cc
+index 87b231861a64..d43b3aef1024 100644
+--- a/gcc/c-family/c-opts.cc
++++ b/gcc/c-family/c-opts.cc
+@@ -1213,20 +1213,9 @@ c_common_post_options (const char **pfilename)
+ if (cxx_dialect >= cxx20)
+ flag_concepts = 1;
+
+- /* Enable lifetime extension of range based for temporaries for C++23.
+- Diagnose -std=c++23 -fno-range-for-ext-temps. */
+- if (cxx_dialect >= cxx23)
+- {
+- if (OPTION_SET_P (flag_range_for_ext_temps)
+- && !flag_range_for_ext_temps)
+- error ("%<-fno-range-for-ext-temps%> is incompatible with C++23");
+- flag_range_for_ext_temps = 1;
+- }
+- /* Otherwise default to enabled in GNU modes but allow user to override. */
+- else if (cxx_dialect >= cxx11
+- && !flag_iso
+- && !OPTION_SET_P (flag_range_for_ext_temps))
+- flag_range_for_ext_temps = 1;
++ /* Enable lifetime extension of range based for temporaries for C++23. */
++ SET_OPTION_IF_UNSET (&global_options, &global_options_set,
++ flag_range_for_ext_temps, cxx_dialect >= cxx23);
+
+ /* -fimmediate-escalation has no effect when immediate functions are not
+ supported. */
+diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
+index 0aef2abf05b9..56d43cb67796 100644
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -3548,9 +3548,8 @@ easier, you can use @option{-fno-pretty-templates} to disable them.
+ Enable lifetime extension of C++ range based for temporaries.
+ With @option{-std=c++23} and above this is part of the language standard,
+ so lifetime of the temporaries is extended until the end of the loop
+-regardless of this option. This option allows enabling that behavior also
+-in earlier versions of the standard and is enabled by default in the
+-GNU dialects, from @option{-std=gnu++11} until @option{-std=gnu++20}.
++by default. This option allows enabling that behavior also
++in earlier versions of the standard.
+
+ @opindex fno-rtti
+ @opindex frtti
+diff --git a/gcc/testsuite/g++.dg/cpp23/range-for3.C b/gcc/testsuite/g++.dg/cpp23/range-for3.C
+index 301e25886ec6..f95b21b3ceee 100644
+--- a/gcc/testsuite/g++.dg/cpp23/range-for3.C
++++ b/gcc/testsuite/g++.dg/cpp23/range-for3.C
+@@ -1,7 +1,7 @@
+ // P2718R0 - Wording for P2644R1 Fix for Range-based for Loop
+ // { dg-do run { target c++11 } }
+-// Verify -frange-for-ext-temps is set by default in -std=gnu++* modes.
+-// { dg-options "" }
++// Verify -frange-for-ext-temps works in earlier standards.
++// { dg-additional-options "-frange-for-ext-temps" }
+
+ #define RANGE_FOR_EXT_TEMPS 1
+ #include "range-for1.C"
+diff --git a/gcc/testsuite/g++.dg/cpp23/range-for4.C b/gcc/testsuite/g++.dg/cpp23/range-for4.C
+index f8c380d32c72..16204974bac9 100644
+--- a/gcc/testsuite/g++.dg/cpp23/range-for4.C
++++ b/gcc/testsuite/g++.dg/cpp23/range-for4.C
+@@ -1,7 +1,7 @@
+ // P2718R0 - Wording for P2644R1 Fix for Range-based for Loop
+ // { dg-do run { target c++11 } }
+-// Verify -frange-for-ext-temps is set by default in -std=gnu++* modes.
++// Verify -frange-for-ext-temps is not set by default in -std=gnu++* modes.
+ // { dg-options "" }
+
+-#define RANGE_FOR_EXT_TEMPS 1
++#define RANGE_FOR_EXT_TEMPS 0
+ #include "range-for2.C"
+diff --git a/libgomp/testsuite/libgomp.c++/range-for-4.C b/libgomp/testsuite/libgomp.c++/range-for-4.C
+index 3c10e7349af7..aa6e4da523c1 100644
+--- a/libgomp/testsuite/libgomp.c++/range-for-4.C
++++ b/libgomp/testsuite/libgomp.c++/range-for-4.C
+@@ -3,5 +3,5 @@
+ // { dg-additional-options "-std=gnu++17" }
+ // { dg-require-effective-target tls_runtime }
+
+-#define RANGE_FOR_EXT_TEMPS 1
++#define RANGE_FOR_EXT_TEMPS 0
+ #include "range-for-1.C"
+--
+2.43.5
diff --git a/sys-devel/gcc/files/gcc-15.0.1_pre20250209-range-for-mariadb.patch b/sys-devel/gcc/files/gcc-15.0.1_pre20250209-range-for-mariadb.patch
new file mode 100644
index 000000000000..8ffe1b558b2e
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-15.0.1_pre20250209-range-for-mariadb.patch
@@ -0,0 +1,530 @@
+https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=26baa2c09b39abf037afad349a318dc5734eae25
+
+From 26baa2c09b39abf037afad349a318dc5734eae25 Mon Sep 17 00:00:00 2001
+From: Jakub Jelinek <jakub@redhat.com>
+Date: Thu, 13 Feb 2025 10:21:29 +0100
+Subject: [PATCH] c++: Fix up regressions caused by for/while loops with
+ declarations [PR118822]
+
+The recent PR86769 r15-7426 changes regressed the following two testcases,
+the first one is more important as it is derived from real-world code.
+
+The first problem is that the chosen
+prep = do_pushlevel (sk_block);
+// emit something
+body = push_stmt_list ();
+// emit further stuff
+body = pop_stmt_list (body);
+prep = do_poplevel (prep);
+way of constructing the {FOR,WHILE}_COND_PREP and {FOR,WHILE}_BODY
+isn't reliable. If during parsing a label is seen in the body and then
+some decl with destructors, sk_cleanup transparent scope is added, but
+the correspondiong result from push_stmt_list is saved in
+*current_binding_level and pop_stmt_list then pops even that statement list
+but only do_poplevel actually attempts to pop the sk_cleanup scope and so we
+ICE.
+The reason for not doing do_pushlevel (sk_block); do_pushlevel (sk_block);
+is that variables should be in the same scope (otherwise various e.g.
+redeclaration*.C tests FAIL) and doing do_pushlevel (sk_block); do_pushlevel
+(sk_cleanup); wouldn't work either as do_poplevel would silently unwind even
+the cleanup one.
+
+The second problem is that my assumption that the declaration in the
+condition will have zero or one cleanup is just wrong, at least for
+structured bindings used as condition, there can be as many cleanups as
+there are names in the binding + 1.
+
+So, the following patch changes the earlier approach. Nothing is removed
+from the {FOR,WHILE}_COND_PREP subtrees while doing adjust_loop_decl_cond,
+push_stmt_list isn't called either; all it does is remember as an integer
+the number of cleanups (CLEANUP_STMT at the end of the STATEMENT_LISTs)
+from querying stmt_list_stack and finding the initial *body_p in there
+(that integer is stored into {FOR,WHILE}_COND_CLEANUP), and temporarily
+{FOR,WHILE}_BODY is set to the last statement (if any) in the innermost
+STATEMENT_LIST at the adjust_loop_decl_cond time; then at
+finish_{for,while}_stmt a new finish_loop_cond_prep routine takes care of
+do_poplevel for the scope (which is in {FOR,WHILE}_COND_PREP) and finds
+given {FOR,WHILE}_COND_CLEANUP number and {FOR,WHILE}_BODY tree the right
+spot where body statements start and moves that into {FOR,WHILE}_BODY.
+Finally genericize_c_loop then inserts the cond, body, continue label, expr
+into the right subtree of {FOR,WHILE}_COND_PREP.
+The constexpr evaluation unfortunately had to be changed as well, because
+we don't want to evaluate everything in BIND_EXPR_BODY (*_COND_PREP ())
+right away, we want to evaluate it with the exception of the CLEANUP_STMT
+cleanups at the end (given {FOR,WHILE}_COND_CLEANUP levels), and defer
+the evaluation of the cleanups until after cond, body, expr are evaluated.
+
+2025-02-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/118822
+ PR c++/118833
+gcc/
+ * tree-iterator.h (tsi_split_stmt_list): Declare.
+ * tree-iterator.cc (tsi_split_stmt_list): New function.
+gcc/c-family/
+ * c-common.h (WHILE_COND_CLEANUP): Change description in comment.
+ (FOR_COND_CLEANUP): Likewise.
+ * c-gimplify.cc (genericize_c_loop): Adjust for COND_CLEANUP
+ being CLEANUP_STMT/TRY_FINALLY_EXPR trailing nesting depth
+ instead of actual cleanup.
+gcc/cp/
+ * semantics.cc (adjust_loop_decl_cond): Allow multiple trailing
+ CLEANUP_STMT levels in *BODY_P. Set *CLEANUP_P to the number
+ of levels rather than one particular cleanup, keep the cleanups
+ in *PREP_P. Set *BODY_P to the last stmt in the cur_stmt_list
+ or NULL if *CLEANUP_P and the innermost cur_stmt_list is empty.
+ (finish_loop_cond_prep): New function.
+ (finish_while_stmt, finish_for_stmt): Use it. Don't call
+ set_one_cleanup_loc.
+ * constexpr.cc (cxx_eval_loop_expr): Adjust handling of
+ {FOR,WHILE}_COND_{PREP,CLEANUP}.
+gcc/testsuite/
+ * g++.dg/expr/for9.C: New test.
+ * g++.dg/cpp26/decomp12.C: New test.
+---
+ gcc/c-family/c-common.h | 6 +-
+ gcc/c-family/c-gimplify.cc | 41 +++------
+ gcc/cp/constexpr.cc | 97 +++++++++++++++++--
+ gcc/cp/semantics.cc | 128 +++++++++++++++++++-------
+ gcc/testsuite/g++.dg/cpp26/decomp12.C | 46 +++++++++
+ gcc/testsuite/g++.dg/expr/for9.C | 25 +++++
+ gcc/tree-iterator.cc | 22 +++++
+ gcc/tree-iterator.h | 1 +
+ 8 files changed, 297 insertions(+), 69 deletions(-)
+ create mode 100644 gcc/testsuite/g++.dg/cpp26/decomp12.C
+ create mode 100644 gcc/testsuite/g++.dg/expr/for9.C
+
+diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
+index bc238430b7a7..ea6c29750567 100644
+--- a/gcc/c-family/c-common.h
++++ b/gcc/c-family/c-common.h
+@@ -1518,7 +1518,8 @@ extern tree build_userdef_literal (tree suffix_id, tree value,
+
+ /* WHILE_STMT accessors. These give access to the condition of the
+ while statement, the body, and name of the while statement, and
+- condition preparation statements and its cleanup, respectively. */
++ condition preparation statements and number of its nested cleanups,
++ respectively. */
+ #define WHILE_COND(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 0)
+ #define WHILE_BODY(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 1)
+ #define WHILE_NAME(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 2)
+@@ -1533,7 +1534,8 @@ extern tree build_userdef_literal (tree suffix_id, tree value,
+
+ /* FOR_STMT accessors. These give access to the init statement,
+ condition, update expression, body and name of the for statement,
+- and condition preparation statements and its cleanup, respectively. */
++ and condition preparation statements and number of its nested cleanups,
++ respectively. */
+ #define FOR_INIT_STMT(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 0)
+ #define FOR_COND(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 1)
+ #define FOR_EXPR(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 2)
+diff --git a/gcc/c-family/c-gimplify.cc b/gcc/c-family/c-gimplify.cc
+index d53e0c2dc567..dc5e80dfa6be 100644
+--- a/gcc/c-family/c-gimplify.cc
++++ b/gcc/c-family/c-gimplify.cc
+@@ -258,8 +258,10 @@ expr_loc_or_loc (const_tree expr, location_t or_loc)
+ for C++ for/while loops with variable declaration as condition. COND_PREP
+ is a BIND_EXPR with the declaration and initialization of the condition
+ variable, into which COND, BODY, continue label if needed and INCR if
+- non-NULL should be appended, and COND_CLEANUP are statements which should
+- be evaluated after that or if anything in COND, BODY or INCR throws. */
++ non-NULL should be appended, and COND_CLEANUP is number of nested
++ CLEANUP_STMT -> TRY_FINALLY_EXPR statements at the end. If non-NULL,
++ COND, BODY, continue label if needed and INCR if non-NULL should be
++ appended to the body of the COND_CLEANUP's nested TRY_FINALLY_EXPR. */
+
+ static void
+ genericize_c_loop (tree *stmt_p, location_t start_locus, tree cond, tree body,
+@@ -278,7 +280,6 @@ genericize_c_loop (tree *stmt_p, location_t start_locus, tree cond, tree body,
+ walk_tree_1 (&cond_prep, func, data, NULL, lh);
+ walk_tree_1 (&cond, func, data, NULL, lh);
+ walk_tree_1 (&incr, func, data, NULL, lh);
+- walk_tree_1 (&cond_cleanup, func, data, NULL, lh);
+
+ blab = begin_bc_block (bc_break, start_locus);
+ clab = begin_bc_block (bc_continue, start_locus);
+@@ -309,36 +310,24 @@ genericize_c_loop (tree *stmt_p, location_t start_locus, tree cond, tree body,
+ EXPR;
+ goto top;
+
+- or
+-
+- try {
+- if (COND); else break;
+- BODY;
+- cont:
+- EXPR;
+- } finally {
+- COND_CLEANUP
+- }
+-
+- appended into COND_PREP body. */
++ appended into COND_PREP body or body of some TRY_FINALLY_EXPRs
++ at the end of COND_PREP. */
+ gcc_assert (cond_is_first && TREE_CODE (cond_prep) == BIND_EXPR);
+ tree top = build1 (LABEL_EXPR, void_type_node,
+ create_artificial_label (start_locus));
+ exit = build1 (GOTO_EXPR, void_type_node, LABEL_EXPR_LABEL (top));
+ append_to_statement_list (top, &outer_stmt_list);
+ append_to_statement_list (cond_prep, &outer_stmt_list);
+- stmt_list = BIND_EXPR_BODY (cond_prep);
+- BIND_EXPR_BODY (cond_prep) = NULL_TREE;
+ stmt_list_p = &BIND_EXPR_BODY (cond_prep);
+- if (cond_cleanup && TREE_SIDE_EFFECTS (cond_cleanup))
+- {
+- t = build2_loc (EXPR_LOCATION (cond_cleanup), TRY_FINALLY_EXPR,
+- void_type_node, NULL_TREE, cond_cleanup);
+- append_to_statement_list (t, &stmt_list);
+- *stmt_list_p = stmt_list;
+- stmt_list_p = &TREE_OPERAND (t, 0);
+- stmt_list = NULL_TREE;
+- }
++ if (cond_cleanup)
++ for (unsigned depth = tree_to_uhwi (cond_cleanup); depth; --depth)
++ {
++ t = tsi_stmt (tsi_last (*stmt_list_p));
++ gcc_assert (TREE_CODE (t) == TRY_FINALLY_EXPR);
++ stmt_list_p = &TREE_OPERAND (t, 0);
++ }
++ stmt_list = *stmt_list_p;
++ *stmt_list_p = NULL_TREE;
+ tree after_cond = create_artificial_label (cond_locus);
+ tree goto_after_cond = build1 (GOTO_EXPR, void_type_node, after_cond);
+ t = build1 (GOTO_EXPR, void_type_node, get_bc_label (bc_break));
+diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc
+index f142dd32bc80..299b13456873 100644
+--- a/gcc/cp/constexpr.cc
++++ b/gcc/cp/constexpr.cc
+@@ -7153,6 +7153,7 @@ cxx_eval_loop_expr (const constexpr_ctx *ctx, tree t,
+
+ tree body, cond = NULL_TREE, expr = NULL_TREE;
+ tree cond_prep = NULL_TREE, cond_cleanup = NULL_TREE;
++ unsigned cond_cleanup_depth = 0;
+ int count = 0;
+ switch (TREE_CODE (t))
+ {
+@@ -7188,11 +7189,25 @@ cxx_eval_loop_expr (const constexpr_ctx *ctx, tree t,
+ }
+ if (cond_prep)
+ gcc_assert (TREE_CODE (cond_prep) == BIND_EXPR);
+- auto cleanup_cond = [=] {
++ auto cleanup_cond = [&] {
+ /* Clean up the condition variable after each iteration. */
+- if (cond_cleanup && !*non_constant_p)
+- cxx_eval_constant_expression (ctx, cond_cleanup, vc_discard,
+- non_constant_p, overflow_p);
++ if (cond_cleanup_depth && !*non_constant_p)
++ {
++ auto_vec<tree, 4> cleanups (cond_cleanup_depth);
++ tree s = BIND_EXPR_BODY (cond_prep);
++ unsigned i;
++ for (i = cond_cleanup_depth; i; --i)
++ {
++ tree_stmt_iterator iter = tsi_last (s);
++ s = tsi_stmt (iter);
++ cleanups.quick_push (CLEANUP_EXPR (s));
++ s = CLEANUP_BODY (s);
++ }
++ tree c;
++ FOR_EACH_VEC_ELT_REVERSE (cleanups, i, c)
++ cxx_eval_constant_expression (ctx, c, vc_discard, non_constant_p,
++ overflow_p);
++ }
+ if (cond_prep)
+ for (tree decl = BIND_EXPR_VARS (cond_prep);
+ decl; decl = DECL_CHAIN (decl))
+@@ -7227,9 +7242,77 @@ cxx_eval_loop_expr (const constexpr_ctx *ctx, tree t,
+ for (tree decl = BIND_EXPR_VARS (cond_prep);
+ decl; decl = DECL_CHAIN (decl))
+ ctx->global->clear_value (decl);
+- cxx_eval_constant_expression (ctx, BIND_EXPR_BODY (cond_prep),
+- vc_discard, non_constant_p,
+- overflow_p, jump_target);
++ if (cond_cleanup)
++ {
++ /* If COND_CLEANUP is non-NULL, we need to evaluate DEPTH
++ nested STATEMENT_LISTs from inside of BIND_EXPR_BODY,
++ but defer the evaluation of CLEANUP_EXPRs of CLEANUP_STMT
++ at the end of those STATEMENT_LISTs. */
++ cond_cleanup_depth = 0;
++ tree s = BIND_EXPR_BODY (cond_prep);
++ for (unsigned depth = tree_to_uhwi (cond_cleanup);
++ depth; --depth)
++ {
++ for (tree_stmt_iterator i = tsi_start (s);
++ !tsi_end_p (i); ++i)
++ {
++ tree stmt = *i;
++ if (TREE_CODE (stmt) == DEBUG_BEGIN_STMT)
++ continue;
++ if (tsi_one_before_end_p (i))
++ {
++ /* The last statement in the STATEMENT_LIST
++ has to be a CLEANUP_STMT (verified in
++ finish_loop_cond_prep). We want to
++ evaluate just its CLEANUP_BODY part but not
++ CLEANUP_EXPR part just yet. */
++ gcc_assert (TREE_CODE (stmt) == CLEANUP_STMT);
++ /* If the CLEANUP_STMT is not actually to be
++ evaluated, don't increment cond_cleanup_depth
++ so that we don't evaluate the CLEANUP_EXPR
++ for it later either. */
++ if (*jump_target)
++ {
++ depth = 1;
++ break;
++ }
++ ++cond_cleanup_depth;
++ /* If not in the innermost one, next iteration
++ will handle CLEANUP_BODY similarly. */
++ if (depth > 1)
++ {
++ s = CLEANUP_BODY (stmt);
++ break;
++ }
++ /* The innermost one can be evaluated normally. */
++ cxx_eval_constant_expression (ctx,
++ CLEANUP_BODY (stmt),
++ vc_discard,
++ non_constant_p,
++ overflow_p,
++ jump_target);
++ break;
++ }
++ /* And so should be evaluated statements which aren't
++ last in the STATEMENT_LIST. */
++ cxx_eval_constant_expression (ctx, stmt, vc_discard,
++ non_constant_p, overflow_p,
++ jump_target);
++ if (*non_constant_p
++ || returns (jump_target)
++ || breaks (jump_target)
++ || continues (jump_target))
++ {
++ depth = 1;
++ break;
++ }
++ }
++ }
++ }
++ else
++ cxx_eval_constant_expression (ctx, BIND_EXPR_BODY (cond_prep),
++ vc_discard, non_constant_p,
++ overflow_p, jump_target);
+ }
+
+ if (cond)
+diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc
+index 8a2d86576fb0..7c7d3e3c4326 100644
+--- a/gcc/cp/semantics.cc
++++ b/gcc/cp/semantics.cc
+@@ -790,8 +790,8 @@ finish_cond (tree *cond_p, tree expr)
+ while (A x = 42) { }
+ for (; A x = 42;) { }
+ move the *BODY_P statements as a BIND_EXPR into {FOR,WHILE}_COND_PREP
+- and if there is any CLEANUP_STMT at the end, remove that and
+- put the cleanup into {FOR,WHILE}_COND_CLEANUP.
++ and if there are any CLEANUP_STMT at the end, remember their count in
++ {FOR,WHILE}_COND_CLEANUP.
+ genericize_c_loop will then handle it appropriately. In particular,
+ the {FOR,WHILE}_COND, {FOR,WHILE}_BODY, if used continue label and
+ FOR_EXPR will be appended into the {FOR,WHILE}_COND_PREP BIND_EXPR,
+@@ -807,26 +807,88 @@ adjust_loop_decl_cond (tree *body_p, tree *prep_p, tree *cleanup_p)
+ return;
+
+ gcc_assert (!processing_template_decl);
+- if (*body_p != cur_stmt_list)
+- {
+- /* There can be either no cleanup at all, if the condition
+- declaration doesn't have non-trivial destructor, or a single
+- one if it does. In that case extract it into *CLEANUP_P. */
+- gcc_assert (stmt_list_stack->length () > 1
+- && (*stmt_list_stack)[stmt_list_stack->length ()
+- - 2] == *body_p);
+- tree_stmt_iterator last = tsi_last (*body_p);
+- gcc_assert (tsi_one_before_end_p (last)
+- && TREE_CODE (tsi_stmt (last)) == CLEANUP_STMT
+- && CLEANUP_BODY (tsi_stmt (last)) == cur_stmt_list
+- && tsi_end_p (tsi_last (cur_stmt_list))
+- && !CLEANUP_EH_ONLY (tsi_stmt (last)));
+- *cleanup_p = CLEANUP_EXPR (tsi_stmt (last));
+- tsi_delink (&last);
++ *prep_p = *body_p;
++ if (*prep_p != cur_stmt_list)
++ {
++ /* There can be just one CLEANUP_STMT, or there could be multiple
++ nested CLEANUP_STMTs, e.g. for structured bindings used as
++ condition. */
++ gcc_assert (stmt_list_stack->length () > 1);
++ for (unsigned i = stmt_list_stack->length () - 2; ; --i)
++ {
++ tree t = (*stmt_list_stack)[i];
++ tree_stmt_iterator last = tsi_last (t);
++ gcc_assert (tsi_one_before_end_p (last)
++ && TREE_CODE (tsi_stmt (last)) == CLEANUP_STMT
++ && (CLEANUP_BODY (tsi_stmt (last))
++ == (*stmt_list_stack)[i + 1])
++ && !CLEANUP_EH_ONLY (tsi_stmt (last)));
++ if (t == *prep_p)
++ {
++ *cleanup_p = build_int_cst (long_unsigned_type_node,
++ stmt_list_stack->length () - 1 - i);
++ break;
++ }
++ gcc_assert (i >= 1);
++ }
+ }
+ current_binding_level->keep = true;
+- *prep_p = *body_p;
+- *body_p = push_stmt_list ();
++ tree_stmt_iterator iter = tsi_last (cur_stmt_list);
++ /* Temporarily store in {FOR,WHILE}_BODY the last statement of
++ the innnermost statement list or NULL if it has no statement.
++ This is used in finish_loop_cond_prep to find out the splitting
++ point and then {FOR,WHILE}_BODY will be changed to the actual
++ body. */
++ if (tsi_end_p (iter))
++ *body_p = NULL_TREE;
++ else
++ *body_p = tsi_stmt (iter);
++}
++
++/* Finalize {FOR,WHILE}_{BODY,COND_PREP} after the loop body.
++ The above function initialized *BODY_P to the last statement
++ in *PREP_P at that point.
++ Call do_poplevel on *PREP_P and move everything after that
++ former last statement into *BODY_P. genericize_c_loop
++ will later put those parts back together.
++ CLEANUP is {FOR,WHILE}_COND_CLEANUP. */
++
++static void
++finish_loop_cond_prep (tree *body_p, tree *prep_p, tree cleanup)
++{
++ *prep_p = do_poplevel (*prep_p);
++ gcc_assert (TREE_CODE (*prep_p) == BIND_EXPR);
++ if (BIND_EXPR_BODY (*prep_p) == *body_p)
++ {
++ gcc_assert (cleanup == NULL_TREE);
++ *body_p = build_empty_stmt (input_location);
++ return;
++ }
++ tree stmt_list = BIND_EXPR_BODY (*prep_p);
++ gcc_assert (TREE_CODE (stmt_list) == STATEMENT_LIST);
++ if (cleanup)
++ {
++ tree_stmt_iterator iter = tsi_last (stmt_list);
++ gcc_assert (TREE_CODE (tsi_stmt (iter)) == CLEANUP_STMT);
++ for (unsigned depth = tree_to_uhwi (cleanup); depth > 1; --depth)
++ {
++ gcc_assert (TREE_CODE (CLEANUP_BODY (tsi_stmt (iter)))
++ == STATEMENT_LIST);
++ iter = tsi_last (CLEANUP_BODY (tsi_stmt (iter)));
++ gcc_assert (TREE_CODE (tsi_stmt (iter)) == CLEANUP_STMT);
++ }
++ if (*body_p == NULL_TREE)
++ {
++ *body_p = CLEANUP_BODY (tsi_stmt (iter));
++ CLEANUP_BODY (tsi_stmt (iter)) = build_empty_stmt (input_location);
++ return;
++ }
++ stmt_list = CLEANUP_BODY (tsi_stmt (iter));
++ }
++ tree_stmt_iterator iter = tsi_start (stmt_list);
++ while (tsi_stmt (iter) != *body_p)
++ tsi_next (&iter);
++ *body_p = tsi_split_stmt_list (input_location, iter);
+ }
+
+ /* Finish a goto-statement. */
+@@ -1437,14 +1499,13 @@ void
+ finish_while_stmt (tree while_stmt)
+ {
+ end_maybe_infinite_loop (boolean_true_node);
+- WHILE_BODY (while_stmt)
+- = (WHILE_COND_PREP (while_stmt)
+- ? pop_stmt_list (WHILE_BODY (while_stmt))
+- : do_poplevel (WHILE_BODY (while_stmt)));
+- finish_loop_cond (&WHILE_COND (while_stmt), WHILE_BODY (while_stmt));
+ if (WHILE_COND_PREP (while_stmt))
+- WHILE_COND_PREP (while_stmt) = do_poplevel (WHILE_COND_PREP (while_stmt));
+- set_one_cleanup_loc (WHILE_COND_CLEANUP (while_stmt), input_location);
++ finish_loop_cond_prep (&WHILE_BODY (while_stmt),
++ &WHILE_COND_PREP (while_stmt),
++ WHILE_COND_CLEANUP (while_stmt));
++ else
++ WHILE_BODY (while_stmt) = do_poplevel (WHILE_BODY (while_stmt));
++ finish_loop_cond (&WHILE_COND (while_stmt), WHILE_BODY (while_stmt));
+ }
+
+ /* Begin a do-statement. Returns a newly created DO_STMT if
+@@ -1709,17 +1770,16 @@ finish_for_stmt (tree for_stmt)
+ RANGE_FOR_BODY (for_stmt) = do_poplevel (RANGE_FOR_BODY (for_stmt));
+ else
+ {
+- FOR_BODY (for_stmt)
+- = (FOR_COND_PREP (for_stmt)
+- ? pop_stmt_list (FOR_BODY (for_stmt))
+- : do_poplevel (FOR_BODY (for_stmt)));
++ if (FOR_COND_PREP (for_stmt))
++ finish_loop_cond_prep (&FOR_BODY (for_stmt),
++ &FOR_COND_PREP (for_stmt),
++ FOR_COND_CLEANUP (for_stmt));
++ else
++ FOR_BODY (for_stmt) = do_poplevel (FOR_BODY (for_stmt));
+ if (FOR_COND (for_stmt))
+ finish_loop_cond (&FOR_COND (for_stmt),
+ FOR_EXPR (for_stmt) ? integer_one_node
+ : FOR_BODY (for_stmt));
+- if (FOR_COND_PREP (for_stmt))
+- FOR_COND_PREP (for_stmt) = do_poplevel (FOR_COND_PREP (for_stmt));
+- set_one_cleanup_loc (FOR_COND_CLEANUP (for_stmt), input_location);
+ }
+
+ /* Pop the scope for the body of the loop. */
+diff --git a/gcc/tree-iterator.cc b/gcc/tree-iterator.cc
+index db2219c62489..b7e2b421c5ee 100644
+--- a/gcc/tree-iterator.cc
++++ b/gcc/tree-iterator.cc
+@@ -284,6 +284,28 @@ tsi_delink (tree_stmt_iterator *i)
+ i->ptr = next;
+ }
+
++/* Split a STATEMENT_LIST in I.contrainer into two, all statements
++ from the start until I.ptr inclusive will remain in the original
++ one, all statements after I.ptr are removed from that STATEMENT_LIST
++ and returned as a new STATEMENT_LIST. If I is the last statement,
++ an empty statement with LOC location is returned. */
++
++tree
++tsi_split_stmt_list (location_t loc, tree_stmt_iterator i)
++{
++ if (tsi_one_before_end_p (i))
++ return build_empty_stmt (loc);
++ tsi_next (&i);
++ tree ret = NULL_TREE;
++ while (!tsi_end_p (i))
++ {
++ tree t = tsi_stmt (i);
++ tsi_delink (&i);
++ append_to_statement_list_force (t, &ret);
++ }
++ return ret;
++}
++
+ /* Return the first expression in a sequence of COMPOUND_EXPRs, or in
+ a STATEMENT_LIST, disregarding DEBUG_BEGIN_STMTs, recursing into a
+ STATEMENT_LIST if that's the first non-DEBUG_BEGIN_STMT. */
+diff --git a/gcc/tree-iterator.h b/gcc/tree-iterator.h
+index 27795e9ee2b8..d1bc9014c65b 100644
+--- a/gcc/tree-iterator.h
++++ b/gcc/tree-iterator.h
+@@ -138,6 +138,7 @@ extern void tsi_link_after (tree_stmt_iterator *, tree,
+ enum tsi_iterator_update);
+
+ extern void tsi_delink (tree_stmt_iterator *);
++extern tree tsi_split_stmt_list (location_t, tree_stmt_iterator);
+
+ extern tree alloc_stmt_list (void);
+ extern void free_stmt_list (tree);
+--
+2.43.5
diff --git a/sys-devel/gcc/gcc-12.4.1_p20250213.ebuild b/sys-devel/gcc/gcc-12.4.1_p20250213.ebuild
new file mode 100644
index 000000000000..83011b194d30
--- /dev/null
+++ b/sys-devel/gcc/gcc-12.4.1_p20250213.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+TOOLCHAIN_HAS_TESTS=1
+PATCH_GCC_VER="12.4.0"
+PATCH_VER="2"
+MUSL_VER="1"
+MUSL_GCC_VER="12.4.0"
+PYTHON_COMPAT=( python3_{10..12} )
+
+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=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~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}"
+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_user
+}
diff --git a/sys-devel/gcc/gcc-13.3.1_p20250214.ebuild b/sys-devel/gcc/gcc-13.3.1_p20250214.ebuild
new file mode 100644
index 000000000000..ac245b9b4177
--- /dev/null
+++ b/sys-devel/gcc/gcc-13.3.1_p20250214.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+TOOLCHAIN_HAS_TESTS=1
+PATCH_GCC_VER="13.3.0"
+MUSL_GCC_VER="13.2.0"
+PATCH_VER="2"
+MUSL_VER="2"
+PYTHON_COMPAT=( python3_{10..12} )
+
+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=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~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}"
+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}"/${PN}-13-fix-cross-fixincludes.patch
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-15.0.1_pre20250209.ebuild b/sys-devel/gcc/gcc-15.0.1_pre20250209-r1.ebuild
index 55be6a99ea8d..c30b842f308f 100644
--- a/sys-devel/gcc/gcc-15.0.1_pre20250209.ebuild
+++ b/sys-devel/gcc/gcc-15.0.1_pre20250209-r1.ebuild
@@ -50,4 +50,6 @@ src_prepare() {
toolchain_src_prepare
eapply_user
+ eapply "${FILESDIR}"/${P}-coro.patch
+ eapply "${FILESDIR}"/${P}-range-for-mariadb.patch
}