get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2224160/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2224160,
    "url": "http://patchwork.ozlabs.org/api/patches/2224160/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260417020830.4154676-2-andrew.pinski@oss.qualcomm.com/",
    "project": {
        "id": 17,
        "url": "http://patchwork.ozlabs.org/api/projects/17/?format=api",
        "name": "GNU Compiler Collection",
        "link_name": "gcc",
        "list_id": "gcc-patches.gcc.gnu.org",
        "list_email": "gcc-patches@gcc.gnu.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260417020830.4154676-2-andrew.pinski@oss.qualcomm.com>",
    "list_archive_url": null,
    "date": "2026-04-17T02:08:30",
    "name": "[GCC17-PATCH,2/2] phiopt: Allow for more than 2 predecessors for join block for cselim-limited in phiopt [PR123113]",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "8d7a94bc6fc2e2df07a3cd90422d6fb071ee443e",
    "submitter": {
        "id": 91428,
        "url": "http://patchwork.ozlabs.org/api/people/91428/?format=api",
        "name": "Andrew Pinski",
        "email": "andrew.pinski@oss.qualcomm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260417020830.4154676-2-andrew.pinski@oss.qualcomm.com/mbox/",
    "series": [
        {
            "id": 500220,
            "url": "http://patchwork.ozlabs.org/api/series/500220/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=500220",
            "date": "2026-04-17T02:08:29",
            "name": "[GCC17-PATCH,1/2] phiopt: Set cfgchanged if cselim-limited happened",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/500220/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2224160/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2224160/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "gcc-patches@gcc.gnu.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "gcc-patches@gcc.gnu.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=T123cWb3;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=C2Q6j5yh;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)",
            "sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=T123cWb3;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=C2Q6j5yh",
            "sourceware.org; dmarc=none (p=none dis=none)\n header.from=oss.qualcomm.com",
            "sourceware.org;\n spf=pass smtp.mailfrom=oss.qualcomm.com",
            "server2.sourceware.org;\n arc=none smtp.remote-ip=205.220.180.131"
        ],
        "Received": [
            "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fxdby6W64z1yGt\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 12:09:18 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 0E6B14BA23FA\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 02:09:16 +0000 (GMT)",
            "from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com\n [205.220.180.131])\n by sourceware.org (Postfix) with ESMTPS id 4EE7E4BA23F1\n for <gcc-patches@gcc.gnu.org>; Fri, 17 Apr 2026 02:08:37 +0000 (GMT)",
            "from pps.filterd (m0279871.ppops.net [127.0.0.1])\n by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63H19Hvg670413\n for <gcc-patches@gcc.gnu.org>; Fri, 17 Apr 2026 02:08:36 GMT",
            "from mail-pj1-f71.google.com (mail-pj1-f71.google.com\n [209.85.216.71])\n by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dkaxcr4qg-1\n (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n for <gcc-patches@gcc.gnu.org>; Fri, 17 Apr 2026 02:08:36 +0000 (GMT)",
            "by mail-pj1-f71.google.com with SMTP id\n 98e67ed59e1d1-35845fcf0f5so293893a91.0\n for <gcc-patches@gcc.gnu.org>; Thu, 16 Apr 2026 19:08:36 -0700 (PDT)",
            "from xeond2.wrightpinski.org ([98.97.39.214])\n by smtp.gmail.com with ESMTPSA id\n 98e67ed59e1d1-361410a7b95sm314182a91.11.2026.04.16.19.08.33\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 16 Apr 2026 19:08:34 -0700 (PDT)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 0E6B14BA23FA",
            "OpenDKIM Filter v2.11.0 sourceware.org 4EE7E4BA23F1"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 4EE7E4BA23F1",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 4EE7E4BA23F1",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776391717; cv=none;\n b=RKToR2ze0gjcwlYc/NdeGNXo1NSlpqIFGrGARiycT/FNgmFDETkUOfgiIUeAicoAhX0mWsJcJXqGPgk/9BZP68t4+s/3Ed/lt3/2dIVhko4kf+sxkcsRo4rpuuhWutpjtn72BDGlMIlDksTSAyt1w3pbbLWZ7jb8yMHU1Qgda3U=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776391717; c=relaxed/simple;\n bh=G2+Lcpls4Lv2abKgy20DdgImNd6qsg5P6xKuhRfixFw=;\n h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID:\n MIME-Version;\n b=NQtjDI920tQdsrXUtqq6Kadmf54kU6x0koSoyLmgrcjLymx2ejL0TvglmN4KEM8MBaOjA2PbPa7xpdTiG5TlYgNsACV6xzbwhk3iaFa9CYjkGzUkZ+RsBDf/cQ3hxnVw59PebRPE98rTYB2qjLLSUCmc3ny0+xLMpQTwOB7TBTQ=",
        "ARC-Authentication-Results": "i=1; server2.sourceware.org",
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n cc:content-transfer-encoding:date:from:in-reply-to:message-id\n :mime-version:references:subject:to; s=qcppdkim1; bh=zdxtkVKocic\n S8caRAbBneWBLCS8cWof0Fui6OLU3QFM=; b=T123cWb3Xwbkr0IW4u+ePD2WmBk\n 6FqmrF1sjubHO5jI96mOQtTHlbUcs2HGdkQ1wuYc2F/S2gGjMzVPJKN6iAlXbV9y\n yJjXRKM0kxQy/qJBY3C/OBgw9DyAx6YHQVAsqLUvsjNck/jaOrLUYxLuyiq54Gi+\n buyOTMS7/9zcHjwHMkk1+aQAP8PDRwsVt0R/mJHhRzaNYkJMMsTu66by+gGbO8CA\n zmqRfL8i3LE5Xdd7TuFqB0yTFqpWLpUnHm+FggfWY+LoDpdMhgoTBq2gNVnP2yS4\n 1ukttzfSrVPCa4DhPLMhpNqPB9AzYNx9Fr7FvfV75CSfGk6bWQm06pHnm7Q==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oss.qualcomm.com; s=google; t=1776391715; x=1776996515; darn=gcc.gnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=zdxtkVKocicS8caRAbBneWBLCS8cWof0Fui6OLU3QFM=;\n b=C2Q6j5yhccAoeT6FonMbMOeLNaOjTPOSbr0jqTj3IMofrXcMN5SsjzGalhDM/8Cmko\n zq/bB4JAKJBFxgdZrPRy3zkiBqdTSccQmlAwxGt/UMgNti4+dPlx1XeAeLI+gQNJG0GG\n 7giMJzoazHMhtzysB9Qg52H9BVHEdp0tbgOR9m0lzjNzb9M/2LMl4/txBldG6VbbqtoP\n zJoD1/SGCprjeEY/ZMigJP7uqbNYpCLOAPH0bSG0evIdJYeX90RmOsW6he8KXEa6ZsFg\n X36hFR3005hLZaEDprtDDfKKzlQZy4wx2SGDlQUNAZFshVK5k1+ndvDqEjJRv4r5TlEs\n RPwg=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776391715; x=1776996515;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=zdxtkVKocicS8caRAbBneWBLCS8cWof0Fui6OLU3QFM=;\n b=AQJjrbwHYgDOI7beuOi8lnYrwJ6K3VJWdOUKwsLQ3CyOZnO0Ou3eEUmpN4Y4a7qarQ\n DX4AenvVKtLf4xEBZTXKTxbM9wbxV8lOrmkpqNPe7ScSOsK//Uy/qYNlLeFYwa28SCDP\n rjOmbjOBpOkEvFDyes6Wb/mJiuldtsocUjclbW4Vcmwv1AVHvxDRMIfxokkMh1fwpXg1\n dnTy0n913NMoYjHkBpycQwO8cNnFg+bkT1IYKz1QOOMwSkKTh+jLL+8qhKkict3iR6uK\n +mQ3ojJlsXQj8zidWPjpVRb8DyDVtBRAinZof62pH5a4sdyiXGf/cve1PnTCWLJHOyAL\n PzXw==",
        "X-Gm-Message-State": "AOJu0YxULzxPxFMewbut/yTMrPPyIieQ3AS+7lPk6/rhGUVjGZoG5k7z\n jFek/UW//dCHFG8GtgrbNr+VndL1KhM5STKUYCu6l73z+xYrVfulY+KgyDo6Tv82T8FUYu3g7lg\n 5viTi1Ski0SJhYx/tRslx0wffAZkvkg9sxGz3r2ug6Iv/vIxOGtLAYG+PjRB0SXM6RCQJ",
        "X-Gm-Gg": "AeBDieuLEgRjci9h5+WRkmcJS/AEyjgNaYqRrJEhwqgniFxCEi/T+jhDt6If7h8htib\n zP65k1PGAZ3PcJgAxun7vg/Gw1M++LRN3H1O1Q2ef1PXEWg6BblERYrW/mFyMffNjOLf7RuLTUO\n O1wu1V5m16J7Yk8kws+xRFnfKSQdE0mkh9qiqdlzfSP4jnOqBj8dH8zDRxEYPToZASIrY7pD07C\n Sp0gC4SsHnc0Q4sRG+TFa8oUVVhfOXnmYa/c6UHctfPbzXj6Osi1oUepAFhVgXI+HWLtiQVzysA\n 7srSg0J+BgEVfWq5t4tf11n2zXIs1x67odmyXmvvEb5ZGD3N/gmBdySyuT64+DsxoPEcCqdsyky\n ZJz1H8BjaiL/DSkKIdVyCobX7Wrt7W31HdllWUW/n+jZ2pUawARqqhSLC5QU=",
        "X-Received": [
            "by 2002:a17:90b:3d8e:b0:35f:b9ba:45b4 with SMTP id\n 98e67ed59e1d1-3613feec4d7mr718183a91.0.1776391715069;\n Thu, 16 Apr 2026 19:08:35 -0700 (PDT)",
            "by 2002:a17:90b:3d8e:b0:35f:b9ba:45b4 with SMTP id\n 98e67ed59e1d1-3613feec4d7mr718158a91.0.1776391714438;\n Thu, 16 Apr 2026 19:08:34 -0700 (PDT)"
        ],
        "From": "Andrew Pinski <andrew.pinski@oss.qualcomm.com>",
        "To": "gcc-patches@gcc.gnu.org",
        "Cc": "Andrew Pinski <andrew.pinski@oss.qualcomm.com>",
        "Subject": "[GCC17-PATCH 2/2] phiopt: Allow for more than 2 predecessors for join\n block for cselim-limited in phiopt [PR123113]",
        "Date": "Thu, 16 Apr 2026 19:08:30 -0700",
        "Message-ID": "<20260417020830.4154676-2-andrew.pinski@oss.qualcomm.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260417020830.4154676-1-andrew.pinski@oss.qualcomm.com>",
        "References": "<20260417020830.4154676-1-andrew.pinski@oss.qualcomm.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Authority-Analysis": "v=2.4 cv=JcqMa0KV c=1 sm=1 tr=0 ts=69e19624 cx=c_pps\n a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=V8mNeic1A8NdUVuT7JxKYQ==:17\n a=Dis5saVqfGDL1r-Y:21 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10\n a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22\n a=EUspDBNiAAAA:8 a=a7LIjGWanGxI7XD_oL8A:9 a=uKXjsCUrEbL0IQVhDsJ9:22",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDE3MDAxOSBTYWx0ZWRfX1fv0BrFDT4JY\n VoQf4Osuqm14Spz40gCBbzCQ0fDFSXIJfDgdQw8RvgH2yfvNYyuVVNCT5LtcF4qFQDOL5JIo5YO\n qxYUscjcRGtNKuHyMXagOib3eoElaI9GeqMKdjTFkX8zDw9QagelQqu/ox/HUwpGEjWqjHrrth9\n kESwkLhjVcQTjWY0EkmGcwk3bZKWsxy2nO1G8EVDaFaTwbqS6f0DpacTtZA/AkyXkVzqySvGiGe\n c0Mg3lRf+zeVJcSXFOtkRK4FYxWO1fMIJLe1n0ydmtnbxOmTi7+BIh7NrwqOebdmlYHwVTY4SN4\n QQS4X2U6RGjvoDWO1DYXfmA8zoKWEkxdkN8qM3HUh7eC+LXee1EQ4rD2y8IU4M+97Jg12jyXp9e\n G94t6SU7MeDlBAINtzfd9ZgdMMd1onjcQqZZV949KmmZ/qkWO/1Wl27a5g9UQPhbuoq7eTVY4jK\n oCTvsiIcJLlKTyxX9KQ==",
        "X-Proofpoint-GUID": "1JU3PdiE17aUi9W8dey0xb-Tp9csuZRQ",
        "X-Proofpoint-ORIG-GUID": "1JU3PdiE17aUi9W8dey0xb-Tp9csuZRQ",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-16_04,2026-04-16_03,2025-10-01_01",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n spamscore=0 adultscore=0 clxscore=1015 malwarescore=0 phishscore=0\n suspectscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0\n bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound\n adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000\n definitions=main-2604170019",
        "X-BeenThere": "gcc-patches@gcc.gnu.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "Gcc-patches mailing list <gcc-patches.gcc.gnu.org>",
        "List-Unsubscribe": "<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>",
        "List-Archive": "<https://gcc.gnu.org/pipermail/gcc-patches/>",
        "List-Post": "<mailto:gcc-patches@gcc.gnu.org>",
        "List-Help": "<mailto:gcc-patches-request@gcc.gnu.org?subject=help>",
        "List-Subscribe": "<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>",
        "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"
    },
    "content": "This is the first in the series to remove the constraint in phiopt when doing store\nand operator sinking that the join block needs to have only 2 predecessor edges.\nA forwarder block needs to be created for the new join block.  Since make_forwarder_block\nkeeps around the original bb as new forwarder block, this makes it easier to handle.\nAnd the original phi nodes are also kept around too (though this is not needed\nto be handled for cselim-limited but will be for factoring).\n\nBootstrapped and tested on x86_64-linux-gnu.\n\n\tPR tree-optimization/123113\ngcc/ChangeLog:\n\n\t* tree-ssa-phiopt.cc (edges_split): New function.\n\t(make_forwarder): New function.\n\t(cond_if_else_store_replacement_1): Create the new\n\tforwarder block right before doing the store sinking.\n\t(pass_phiopt::execute): Remove the restriction on cselim_limited\n\tfor 2 predecessors.\n\ngcc/testsuite/ChangeLog:\n\n\t* gcc.dg/tree-ssa/ssa-sink-13.c:\n\t* gcc.dg/tree-ssa/cselim-6.c: New test.\n\nSigned-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>\n---\n gcc/testsuite/gcc.dg/tree-ssa/cselim-6.c    | 18 +++++++++\n gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-13.c |  2 +-\n gcc/tree-ssa-phiopt.cc                      | 43 ++++++++++++++++++++-\n 3 files changed, 61 insertions(+), 2 deletions(-)\n create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/cselim-6.c",
    "diff": "diff --git a/gcc/testsuite/gcc.dg/tree-ssa/cselim-6.c b/gcc/testsuite/gcc.dg/tree-ssa/cselim-6.c\nnew file mode 100644\nindex 00000000000..1f726ccca78\n--- /dev/null\n+++ b/gcc/testsuite/gcc.dg/tree-ssa/cselim-6.c\n@@ -0,0 +1,18 @@\n+/* { dg-do compile } */\n+/* { dg-options \"-O1 -fdump-tree-phiopt1\" } */\n+\n+int t;\n+void f(int a, int b, int c, int d)\n+{\n+  if (a)\n+  {\n+    if (b)\n+     t = c;\n+    else\n+     t = d;\n+  }\n+}\n+\n+/* We should sink/merge the store. */\n+\n+/* { dg-final { scan-tree-dump-times \"t = cstore\" 1 \"phiopt1\" } } */\ndiff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-13.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-13.c\nindex 584fd91f43a..75cb354052b 100644\n--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-13.c\n+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-13.c\n@@ -1,6 +1,6 @@\n /* PR33315 */\n /* { dg-do compile } */\n-/* { dg-options \"-O2 -fdump-tree-sink\" } */\n+/* { dg-options \"-O2 -fdump-tree-sink -fno-ssa-phiopt\" } */\n \n int num;\n int a[20];\ndiff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc\nindex 324559e6a7d..76527ff922c 100644\n--- a/gcc/tree-ssa-phiopt.cc\n+++ b/gcc/tree-ssa-phiopt.cc\n@@ -3115,6 +3115,42 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb,\n   return true;\n }\n \n+/* Callback function for make_forwarder_block,\n+   returns true if the edge src is either of\n+   the 2 basic blocks in the array BBS (DATA). */\n+\n+static bool\n+edges_split (edge e, void *data)\n+{\n+  basic_block *bbs = (basic_block*)data;\n+  return e->src == bbs[0] || e->src == bbs[1];\n+}\n+\n+\n+/* Makes a forwarder block for JOIN_BB such that\n+   THEN_BB and ELSE_BB are the only 2 predecessors\n+   of the block. Note the JOIN_BB is required to be\n+   the same and the PHI nodes of JOIN_BB have to be\n+   the same too.  */\n+\n+static void\n+make_forwarder (basic_block then_bb, basic_block else_bb,\n+\t\tbasic_block join_bb)\n+{\n+  basic_block bbs[2];\n+\n+  /* If the join block already has 2 predecessors, then there\n+     is nothing to be done.  */\n+  if (EDGE_COUNT (join_bb->preds) == 2)\n+    return;\n+  bbs[0] = then_bb;\n+  bbs[1] = else_bb;\n+  edge ne = make_forwarder_block (join_bb, edges_split, bbs);\n+  gcc_assert (join_bb == ne->src);\n+  statistics_counter_event (cfun, \"if-then-else split for inserting common\", 1);\n+}\n+\n+\n /* Do the main work of conditional store replacement.  */\n \n static bool\n@@ -3201,6 +3237,11 @@ cond_if_else_store_replacement_1 (basic_block then_bb, basic_block else_bb,\n   gsi_remove (&gsi, true);\n   release_defs (else_assign);\n \n+  /* If the join bb has more than 2 predecessors,\n+     then we need to create a new join.  */\n+  if (EDGE_COUNT (join_bb->preds) != 2)\n+    make_forwarder (then_bb, else_bb, join_bb);\n+\n   /* 2) Create a PHI node at the join block, with one argument\n \tholding the old RHS, and the other holding the temporary\n \twhere we stored the old memory contents.  */\n@@ -4050,7 +4091,7 @@ pass_phiopt::execute (function *)\n \t  /* Try to see if there are only store in each side of the if\n \t     and try to remove that; don't do this for -Og.\n \t     With sinking the stores we might end up with empty blocks.  */\n-\t  if (EDGE_COUNT (bb3->preds) == 2 && !optimize_debug)\n+\t  if (!optimize_debug)\n \t    while (cond_if_else_store_replacement_limited (bb1, bb2, bb3))\n \t      cfgchanged = true;\n \t}\n",
    "prefixes": [
        "GCC17-PATCH",
        "2/2"
    ]
}