Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2194435/?format=api
{ "id": 2194435, "url": "http://patchwork.ozlabs.org/api/patches/2194435/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260208234313.967053-1-ibuclaw@gdcproject.org/", "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": "<20260208234313.967053-1-ibuclaw@gdcproject.org>", "list_archive_url": null, "date": "2026-02-08T23:43:13", "name": "[committed] d: Fix ICE in output_constant, at varasm.cc:5662 [PR124026]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "dbb784d7b3377b874ccb97623c97d732402cb883", "submitter": { "id": 46728, "url": "http://patchwork.ozlabs.org/api/people/46728/?format=api", "name": "Iain Buclaw", "email": "ibuclaw@gdcproject.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260208234313.967053-1-ibuclaw@gdcproject.org/mbox/", "series": [ { "id": 491448, "url": "http://patchwork.ozlabs.org/api/series/491448/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=491448", "date": "2026-02-08T23:43:13", "name": "[committed] d: Fix ICE in output_constant, at varasm.cc:5662 [PR124026]", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/491448/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2194435/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2194435/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=gdcproject.org header.i=@gdcproject.org\n header.a=rsa-sha256 header.s=MBO0001 header.b=RO4EImVU;\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=gdcproject.org header.i=@gdcproject.org\n header.a=rsa-sha256 header.s=MBO0001 header.b=RO4EImVU", "sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=gdcproject.org", "sourceware.org; spf=pass smtp.mailfrom=gdcproject.org", "server2.sourceware.org;\n arc=none smtp.remote-ip=80.241.56.171" ], "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 4f8PY15005z1xvc\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 09 Feb 2026 10:43:48 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id AB15D4CF2FD6\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 8 Feb 2026 23:43:45 +0000 (GMT)", "from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171])\n by sourceware.org (Postfix) with ESMTPS id 8CC67452C47B\n for <gcc-patches@gcc.gnu.org>; Sun, 8 Feb 2026 23:43:18 +0000 (GMT)", "from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4f8PXM54Cbz9tWx;\n Mon, 9 Feb 2026 00:43:15 +0100 (CET)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org AB15D4CF2FD6", "OpenDKIM Filter v2.11.0 sourceware.org 8CC67452C47B" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 8CC67452C47B", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 8CC67452C47B", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770594198; cv=none;\n b=AY4qrZyNvNxWWHO5VsahY4zAFU9Ui2m16x7V6tzc48lpveRNgD2ChiHtT+pOKBCWRyD++t3bDtS1bAZZ5yLBlkJ4hMXUUWXMK0JKw4mjFM6s78X7Hv+1LMg/5E64pke8sB+eH2yisvbPIlayJtWi4FP1rb71nOLc6QiieOHhuyk=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1770594198; c=relaxed/simple;\n bh=7WRXDVBH3gzTjRc5qsBmejusmSpJpT1x0tT1MHFjvpk=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=qNCcINIuQuD/0SBOksDEIlQyS2uEg1BgsXH8Z3p493oFUJjOc8g55+d9Yee838KawswW/c+TD85tHC661MBJ5mi5u6WHMvuwikgNJACE6xT5XunqGHK9epSj9H7w6bsyJmxOo+fZ2ynhGHQIy3QNOJvkt0To5E7yscxi+kBPPEM=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gdcproject.org;\n s=MBO0001; t=1770594195;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=YAKm2iZ4Xb6f1AKxi5ILlpYqteq6kpmMw9V3bo4617g=;\n b=RO4EImVUiu4mP0ObypB8JUduJhHCITZeEeyHwGHvMfZ/SdzwnSZ0KvIOrSrBOvgrNeHO0l\n W9TaD0hN9WEVz2OytBf8VGu01JkeuBV/X6AAEAm+B9PkULp6abr6xpmk3mu8IcFL60mHyB\n tHYZEV3FOEtmtodO8k4CP+QvHJEDKinGUi3ZnSllH9CldVFev6O5hoiQc35Bv/guqDmAqC\n dyZ25gdKOAlPMN7M0Qlji/XL3tZHmhyuV7og2sQ3bjprnVrQuBmM/NZc8mZ80p/jOHStRt\n SEu+Etgsm/0nXSBr+bTwTGkIzMx8O/Vw3BQcjiO1GXGre/8A4dExOwczuHbWIg==", "From": "Iain Buclaw <ibuclaw@gdcproject.org>", "To": "gcc-patches@gcc.gnu.org", "Cc": "Iain Buclaw <ibuclaw@gdcproject.org>", "Subject": "[committed] d: Fix ICE in output_constant,\n at varasm.cc:5662 [PR124026]", "Date": "Mon, 9 Feb 2026 00:43:13 +0100", "Message-ID": "<20260208234313.967053-1-ibuclaw@gdcproject.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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": "Hi,\n\nThis patch fixes PR124026.\n\nRegstrapped on x86_64-linux-gnu, committed to mainline, and backported\nto releases/gcc-13, gcc-14, and gcc-15.\n\nRegards,\nIain.\n\n---\n\tPR d/124026\n\ngcc/d/ChangeLog:\n\n\t* expr.cc (ExprVisitor::visit (FuncExp *)): Always convert function\n\tliteral to a delegate if the expression expects one.\n---\n gcc/d/expr.cc | 24 ++++++++++++++----------\n 1 file changed, 14 insertions(+), 10 deletions(-)", "diff": "diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc\nindex d05a12d5d09..8c068b083e5 100644\n--- a/gcc/d/expr.cc\n+++ b/gcc/d/expr.cc\n@@ -1871,27 +1871,31 @@ public:\n /* Compile the declaration. */\n build_lambda_tree (e->fd, e->type->toBasetype ());\n \n- /* If nested, this will be a trampoline. */\n- if (e->fd->isNested ())\n- {\n-\ttree func = build_address (get_symbol_decl (e->fd));\n-\ttree object;\n+ tree func = build_address (get_symbol_decl (e->fd));\n+ Type *tb = e->type->toBasetype ();\n \n-\tif (this->constp_)\n+ /* If a delegate is expected, the literal will be inferred as a delegate\n+ even if it accesses no variables from an enclosing function. */\n+ if (tb->ty == TY::Tdelegate)\n+ {\n+\t/* Static delegate variables have no context pointer. */\n+\tif (this->constp_ || !e->fd->isNested ())\n \t {\n-\t /* Static delegate variables have no context pointer. */\n-\t object = null_pointer_node;\n-\t this->result_ = build_method_call (func, object, e->fd->type);\n+\t this->result_ = build_method_call (func, null_pointer_node,\n+\t\t\t\t\t e->fd->type);\n \t TREE_CONSTANT (this->result_) = 1;\n \t }\n \telse\n \t {\n-\t object = get_frame_for_symbol (e->fd);\n+\t gcc_assert (e->fd->isNested ());\n+\t tree object = get_frame_for_symbol (e->fd);\n \t this->result_ = build_method_call (func, object, e->fd->type);\n \t }\n }\n else\n {\n+\t/* The function literal is a function pointer. */\n+\tgcc_assert (tb->ty == TY::Tpointer);\n \tthis->result_ = build_nop (build_ctype (e->type),\n \t\t\t\t build_address (get_symbol_decl (e->fd)));\n }\ndiff --git a/gcc/testsuite/gdc.dg/pr124026.d b/gcc/testsuite/gdc.dg/pr124026.d\nnew file mode 100644\nindex 00000000000..48a3e13eded\n--- /dev/null\n+++ b/gcc/testsuite/gdc.dg/pr124026.d\n@@ -0,0 +1,21 @@\n+// { dg-do compile }\n+struct UDA\n+{\n+ int delegate() foo;\n+}\n+\n+static UDA getUDA(alias S)()\n+{\n+ return __traits(getAttributes, S)[0];\n+}\n+\n+struct S124026\n+{\n+ @UDA({ return 42; }) int a;\n+}\n+\n+void f124026()\n+{\n+ S124026 m;\n+ enum uda = getUDA!(m.a);\n+}\n", "prefixes": [ "committed" ] }