Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2221233/?format=api
{ "id": 2221233, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2221233/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/2c4ed43b-9787-4c50-b0d9-ee213a3bb896@hexco.de/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/1.1/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 }, "msgid": "<2c4ed43b-9787-4c50-b0d9-ee213a3bb896@hexco.de>", "date": "2026-04-08T21:36:12", "name": "- ICE verify_vssa exceeds stack space for big functions [PR124805]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "658425daaaf1dd5ff8e902adcefc32b2baffd4b5", "submitter": { "id": 93079, "url": "http://patchwork.ozlabs.org/api/1.1/people/93079/?format=api", "name": "Heiko Eißfeldt", "email": "heiko.Eissfeldt@hexco.de" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/2c4ed43b-9787-4c50-b0d9-ee213a3bb896@hexco.de/mbox/", "series": [ { "id": 499215, "url": "http://patchwork.ozlabs.org/api/1.1/series/499215/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=499215", "date": "2026-04-08T21:36:12", "name": "- ICE verify_vssa exceeds stack space for big functions [PR124805]", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499215/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2221233/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2221233/checks/", "tags": {}, "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=hexco.de header.i=heiko.eissfeldt@hexco.de\n header.a=rsa-sha256 header.s=s1-ionos header.b=08w8UeJY;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.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=hexco.de header.i=heiko.eissfeldt@hexco.de\n header.a=rsa-sha256 header.s=s1-ionos header.b=08w8UeJY", "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=hexco.de", "sourceware.org; spf=pass smtp.mailfrom=hexco.de", "server2.sourceware.org;\n arc=none smtp.remote-ip=217.72.192.75" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 4frbqM4CLcz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 07:31:42 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 253584BA2E1E\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 8 Apr 2026 21:31:40 +0000 (GMT)", "from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75])\n by sourceware.org (Postfix) with ESMTPS id 221204BA2E0D\n for <gcc-patches@gcc.gnu.org>; Wed, 8 Apr 2026 21:31:09 +0000 (GMT)", "from client.hidden.invalid by mrelayeu.kundenserver.de (mreue107\n [212.227.17.181]) with ESMTPSA (Nemesis) id 1N4h7p-1vR39g14el-013Ok9 for\n <gcc-patches@gcc.gnu.org>; Wed, 08 Apr 2026 23:31:07 +0200" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 253584BA2E1E", "OpenDKIM Filter v2.11.0 sourceware.org 221204BA2E0D" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 221204BA2E0D", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 221204BA2E0D", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775683870; cv=none;\n b=KgLefe6xzQyN2WqvhcFIP1uJV4NrOaWyGXEnD5t0jxJH+Gp2jm1GKWBYPR5IPDdFWR+drGHkyiUKzD1k+U0rl54RJcncaUkmUuuLas27XGmzEmKoMIrrcghj/4K+ekfhSabPDfchC4BIHy0WnB/AVM3duKTKKa6eyXQmAxQiK7E=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775683870; c=relaxed/simple;\n bh=tCEtCEoiYbsBD2GfjK2zcXrtVwjDCeG3QyHfitBH/SI=;\n h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject;\n b=jCDKWUbURyRD0L/Gcs8NexvV/7NkifMCxZDpIzSyE1e3ZfBj9pK9lRZp3MQ7B9qXR6dvY7arCLVyYbuz6+jc22QZfY9yIhTfvQPDWJcGnB74ptJhndQwW0ZbLhGW7ZRxL5SyAufWhca8QXVCRJIvuMkojVYQkkhmAUyF66UL+pw=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=hexco.de;\n s=s1-ionos; t=1775683867; x=1776288667; i=heiko.eissfeldt@hexco.de;\n bh=hlrx+3bVxLTKj3c/NysvVA+icHBoqNxAgGbgGzijopQ=;\n h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:To:From:Subject:\n Content-Type:cc:content-transfer-encoding:content-type:date:from:\n message-id:mime-version:reply-to:subject:to;\n b=08w8UeJY/LfqtgS5Cj/2E0DqhtkMTMaDobVE66iME34gMrcBt3g6Zeqr32N3q8SY\n tUs60W8XTyM9ArL7COdhVAzvplFpJYLQ7sH8hlOpIhyzyvK5MuKSnCSQHLR/KNijl\n 7YgAM17FMBsjxX/4QNV4INkb6Mtg2lgTBXkz9Oumz4qLZLNcL1oNBCmP410Rl9v49\n lq1F34p+XXE4nUXSSVhHHkvM4AQDb2eEbqefTVhJAo5EcB0GbdrJGC2alg8zJiMAe\n 13W0avDFIFqCagLAc9jwKZ+cycNdXWJ2zgPcR19X+/NiJW6ND/OM8Zg5gWeo2+l7q\n 0Wtw8pT8VW+UHX84Iw==", "X-UI-Sender-Class": "55c96926-9e95-11ee-ae09-1f7a4046a0f6", "Message-ID": "<2c4ed43b-9787-4c50-b0d9-ee213a3bb896@hexco.de>", "Date": "Wed, 8 Apr 2026 23:36:12 +0200", "MIME-Version": "1.0", "User-Agent": "Mozilla Thunderbird", "Content-Language": "en-US", "To": "gcc-patches@gcc.gnu.org", "From": "=?utf-8?q?Heiko_Ei=C3=9Ffeldt?= <heiko.Eissfeldt@hexco.de>", "Subject": "[PATCH] - ICE verify_vssa exceeds stack space for big functions\n [PR124805]", "Content-Type": "multipart/signed; micalg=pgp-sha256;\n protocol=\"application/pgp-signature\";\n boundary=\"------------0FoOvqR76HRj3Ydq00blRHfT\"", "X-Provags-ID": "V03:K1:Tx4Tp+f5nLAijsiqx0zPVuUa8m2P6zM3nsjXvQS/wX6eLhcHY2b\n /eHN8E03pZEcAPl6/PwDw873Pi+mb7MBW2Wcv6X+xgvygdhZaDDMd0UApJhWYYN9jbUdEIX\n UHpoS0qAuj63J4xcCTiKYsMI4SL7H3EyOU5C4OxMgRj/bR/fnq00EUYkq62UP+6/Ocgmcjh\n xdbo4OLuGQfhFBJtuGsnA==", "UI-OutboundReport": "notjunk:1;M01:P0:n7in7c0bApA=;olisiY5VWvkqIGmul/FdIbH2qZ3\n K6NBg9jDc2/6ycRJBIWRaWZ+H+XP2G0CW/h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juf\n loG+HAiTcQnePQaLftL030dePSYqNwavYP/RAgY9QSzeZIVS6bMAK5AVV0wbDoQuHW8xZf9Cj\n pyb50Om3KV8dQvLZvCsImTsTcnYx+7SnYMEO56LY/X8vBEdQVjNweGsasrusT/xJ3Sc2C7L3j\n RA/P5wJ1JCXlIxi1loChiKScaqf0+Pd3la5Vta6ZxDy5fjNOXSPZgg0OgLd+R1K6O9GQ/cdmk\n qge5Un4jmIIcF1aoxzi31kayvZp5GfDfAgYnIp5LdUkXvCbdPfuJFKhRLp0goKbC7Wng3VzjZ\n A6pc7CPU5fhpGt/EB8ECSTTbaSMvP+PeGsfSZHPGibK7ZUGS6WpcQWU6Ry2+GZdhy3HR666QR\n hSHhR3YDDc1Ybwc2E1909elZXYEBsIbyhzyYrEtUmLgvesh6Y+D2KzWn9nMkhsh6q0TmgPoJZ\n wUHJ5dcQliGR+ZbpZlW1KGlIVSdxNLvBeT4y+oFz2Ai0bTtpuYKdUxY/oUnDwTyyjo1Oih7s/\n VeUHRhu0otpgkzJVV7Oi4LBK0rAf4rPOCbQYy2cECoa2I4g9g4Ya3UpRE177tOFD2nd/cK7s9\n Dvk0Q93TCxzNfoMeTVrjzcgfTUpEk5Cv0PKdvT2dnf9yBsFYlyoSXELM4NrK2fzqN1fSlVVS6\n Hj7+7YCB16uEoNZkwon7nK1BQVbZmG9vqi3iljoPnu3xKmVj25pfdT/dyZuNOgS53fW3qOGoD\n Xgh+DA8bS4chzx3j6TUMDA1cPa4oNDvzkQaCrU1yLePf2e5NsFbCQOglGfN2Jxt6A5RphLHFP\n jTtUSXS4T6ynDq6xThFOlU5yIbtF1efBLyZmVc=", "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": "The source from PR124561 led to an ICE with --enable-checking, caused by a stack overflow.\nThe recursive verification code verify_vssa in tree-ssa.cc could not handle the extreme\nnumber of basic blocks within the typical limits of stack space.\n\nAs for PR124561 the recursive code was transformed into an iterative version, which\navoided the recursive calls.\n\nA worklist is used, which has as entries a pair of a basic_block and a tree (vdef).\nThe logic of verification steps for each basic_block is unchanged, although the order\nof basic_blocks is changed.\n\nThis fixes PR124805.\n\nReg tested OK.\n\n2026-04-07 Heiko Eißfeldt <heiko@hexco.de>\n\n\tPR middle-end/124805\n\t* tree-ssa.cc (verify_vssa):\n\treplace recursive calls with iteration for lower stack usage", "diff": "diff --git a/gcc/tree-ssa.cc b/gcc/tree-ssa.cc\nindex 3c899eb5979..e110e4acf2b 100644\n--- a/gcc/tree-ssa.cc\n+++ b/gcc/tree-ssa.cc\n@@ -636,96 +636,119 @@ release_defs_bitset (bitmap toremove)\n /* Verify virtual SSA form. */\n \n bool\n-verify_vssa (basic_block bb, tree current_vdef, sbitmap visited)\n+verify_vssa (basic_block bb_start, tree current_vdef, sbitmap visited)\n {\n bool err = false;\n \n- if (!bitmap_set_bit (visited, bb->index))\n- return false;\n+ struct state_t {\n+ basic_block bb;\n+ tree\tvdef;\n+ } state;\n+\n+ auto_vec<state_t, 3> worklist;\n+ state.bb = bb_start;\n+ state.vdef = current_vdef;\n+ worklist.safe_push (state);\n \n- /* Pick up the single virtual PHI def. */\n- gphi *phi = NULL;\n- for (gphi_iterator si = gsi_start_phis (bb); !gsi_end_p (si);\n- gsi_next (&si))\n+ while (!worklist.is_empty ())\n {\n- tree res = gimple_phi_result (si.phi ());\n- if (virtual_operand_p (res))\n+ const auto &state = worklist.pop ();\n+ const auto &bb = state.bb;\n+ current_vdef = state.vdef;\n+\n+ if (!bitmap_set_bit (visited, bb->index))\n+\tcontinue;\n+\n+ /* Pick up the single virtual PHI def. */\n+ gphi *phi = NULL;\n+ for (gphi_iterator si = gsi_start_phis (bb); !gsi_end_p (si);\n+\t gsi_next (&si))\n+\t{\n+\t tree res = gimple_phi_result (si.phi ());\n+\t if (virtual_operand_p (res))\n+\t {\n+\t if (phi)\n+\t\t{\n+\t\t error (\"multiple virtual PHI nodes in BB %d\", bb->index);\n+\t\t print_gimple_stmt (stderr, phi, 0);\n+\t\t print_gimple_stmt (stderr, si.phi (), 0);\n+\t\t err = true;\n+\t\t}\n+\t else\n+\t\tphi = si.phi ();\n+\t }\n+\t}\n+ if (phi)\n \t{\n-\t if (phi)\n+\t current_vdef = gimple_phi_result (phi);\n+\t if (TREE_CODE (current_vdef) != SSA_NAME)\n \t {\n-\t error (\"multiple virtual PHI nodes in BB %d\", bb->index);\n+\t error (\"virtual definition is not an SSA name\");\n \t print_gimple_stmt (stderr, phi, 0);\n-\t print_gimple_stmt (stderr, si.phi (), 0);\n \t err = true;\n \t }\n-\t else\n-\t phi = si.phi ();\n \t}\n- }\n- if (phi)\n- {\n- current_vdef = gimple_phi_result (phi);\n- if (TREE_CODE (current_vdef) != SSA_NAME)\n+\n+ /* Verify stmts. */\n+ for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi);\n+\t gsi_next (&gsi))\n \t{\n-\t error (\"virtual definition is not an SSA name\");\n-\t print_gimple_stmt (stderr, phi, 0);\n-\t err = true;\n+\t gimple *stmt = gsi_stmt (gsi);\n+\t tree vuse = gimple_vuse (stmt);\n+\t if (vuse)\n+\t {\n+\t if (vuse != current_vdef)\n+\t\t{\n+\t\t error (\"stmt with wrong VUSE\");\n+\t\t print_gimple_stmt (stderr, stmt, 0, TDF_VOPS);\n+\t\t fprintf (stderr, \"expected \");\n+\t\t print_generic_expr (stderr, current_vdef);\n+\t\t fprintf (stderr, \"\\n\");\n+\t\t err = true;\n+\t\t}\n+\t tree vdef = gimple_vdef (stmt);\n+\t if (vdef)\n+\t\t{\n+\t\t current_vdef = vdef;\n+\t\t if (TREE_CODE (current_vdef) != SSA_NAME)\n+\t\t {\n+\t\t error (\"virtual definition is not an SSA name\");\n+\t\t print_gimple_stmt (stderr, phi, 0);\n+\t\t err = true;\n+\t\t }\n+\t\t}\n+\t }\n \t}\n- }\n \n- /* Verify stmts. */\n- for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi);\n- gsi_next (&gsi))\n- {\n- gimple *stmt = gsi_stmt (gsi);\n- tree vuse = gimple_vuse (stmt);\n- if (vuse)\n+ /* Verify destination PHI uses and add successors to worklist. */\n+ edge_iterator ei;\n+ edge e;\n+ FOR_EACH_EDGE (e, ei, bb->succs)\n \t{\n-\t if (vuse != current_vdef)\n+\t gphi *phi = get_virtual_phi (e->dest);\n+\t if (phi\n+\t && PHI_ARG_DEF_FROM_EDGE (phi, e) != current_vdef)\n \t {\n-\t error (\"stmt with wrong VUSE\");\n-\t print_gimple_stmt (stderr, stmt, 0, TDF_VOPS);\n+\t error (\"PHI node with wrong VUSE on edge from BB %d\",\n+\t\t e->src->index);\n+\t print_gimple_stmt (stderr, phi, 0, TDF_VOPS);\n \t fprintf (stderr, \"expected \");\n \t print_generic_expr (stderr, current_vdef);\n \t fprintf (stderr, \"\\n\");\n \t err = true;\n \t }\n-\t tree vdef = gimple_vdef (stmt);\n-\t if (vdef)\n+\n+\t /* Add successor BB along with current vdef to worklist. */\n+\t if (!bitmap_bit_p (visited, e->dest->index))\n \t {\n-\t current_vdef = vdef;\n-\t if (TREE_CODE (current_vdef) != SSA_NAME)\n-\t\t{\n-\t\t error (\"virtual definition is not an SSA name\");\n-\t\t print_gimple_stmt (stderr, phi, 0);\n-\t\t err = true;\n-\t\t}\n-\t }\n-\t}\n- }\n+\t state_t new_state;\n+\t new_state.bb = e->dest;\n+\t new_state.vdef = current_vdef;\n \n- /* Verify destination PHI uses and recurse. */\n- edge_iterator ei;\n- edge e;\n- FOR_EACH_EDGE (e, ei, bb->succs)\n- {\n- gphi *phi = get_virtual_phi (e->dest);\n- if (phi\n-\t && PHI_ARG_DEF_FROM_EDGE (phi, e) != current_vdef)\n-\t{\n-\t error (\"PHI node with wrong VUSE on edge from BB %d\",\n-\t\t e->src->index);\n-\t print_gimple_stmt (stderr, phi, 0, TDF_VOPS);\n-\t fprintf (stderr, \"expected \");\n-\t print_generic_expr (stderr, current_vdef);\n-\t fprintf (stderr, \"\\n\");\n-\t err = true;\n+\t worklist.safe_push (new_state);\n+\t }\n \t}\n-\n- /* Recurse. */\n- err |= verify_vssa (e->dest, current_vdef, visited);\n }\n-\n return err;\n }\n \n", "prefixes": [] }