Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2231295/?format=api
{ "id": 2231295, "url": "http://patchwork.ozlabs.org/api/patches/2231295/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260430142138.1223368-1-ppalka@redhat.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": "<20260430142138.1223368-1-ppalka@redhat.com>", "list_archive_url": null, "date": "2026-04-30T14:21:38", "name": "c++/modules: false positive abi_tag mismatch [PR124957]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "bb31094f295620248683b741f3e3e13a7e1ce017", "submitter": { "id": 78319, "url": "http://patchwork.ozlabs.org/api/people/78319/?format=api", "name": "Patrick Palka", "email": "ppalka@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260430142138.1223368-1-ppalka@redhat.com/mbox/", "series": [ { "id": 502314, "url": "http://patchwork.ozlabs.org/api/series/502314/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=502314", "date": "2026-04-30T14:21:38", "name": "c++/modules: false positive abi_tag mismatch [PR124957]", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/502314/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2231295/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2231295/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 (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=Aag82Azn;\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 (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=Aag82Azn", "sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com", "sourceware.org; spf=pass smtp.mailfrom=redhat.com", "server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.133.124" ], "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 4g5xFk0S0Zz1xqf\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 00:22:16 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id C11AE43B5511\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 14:22:14 +0000 (GMT)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by sourceware.org (Postfix) with ESMTP id 66B6643B550E\n for <gcc-patches@gcc.gnu.org>; Thu, 30 Apr 2026 14:21:45 +0000 (GMT)", "from mail-qt1-f198.google.com (mail-qt1-f198.google.com\n [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-436-sYcm-vJpPzOEj7DpL7bVrA-1; Thu, 30 Apr 2026 10:21:43 -0400", "by mail-qt1-f198.google.com with SMTP id\n d75a77b69052e-50d8c183c2eso8249141cf.0\n for <gcc-patches@gcc.gnu.org>; Thu, 30 Apr 2026 07:21:43 -0700 (PDT)", "from idea ([2600:4040:aa66:bf00:9e8e:99ff:fed1:71f])\n by smtp.gmail.com with ESMTPSA id\n d75a77b69052e-5101accd24asm51297841cf.9.2026.04.30.07.21.39\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 30 Apr 2026 07:21:39 -0700 (PDT)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org C11AE43B5511", "OpenDKIM Filter v2.11.0 sourceware.org 66B6643B550E" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 66B6643B550E", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 66B6643B550E", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777558905; cv=none;\n b=vrehbKZ1ZuTYn2MDhkVMAxHJHjmCZgRdR5FsfBzzvPpWwHIWGW+euDflGfEgdT2L0ShxlrO3eZ2nAf1M38mTuVOmFChJ4xSXW8y0yko5fK8FcgdcKZejal6IKPqicng4McFTZm1DO+Bwvb+jB3t/42sRDiAvplrHLD2MB2X7R4I=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777558905; c=relaxed/simple;\n bh=lvQQr+bQSN84ItvwqwDIiV1lin2uhvnI9cdyXOVLj74=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=VmP8nwdPj2Tp96uEp7YFkr4PaWAZPVL4fF4E6XsE0xHt09WTWEKvU44UI/0CZ2SWnyWYtZfInuE8r3ecB2lFCVZGZuKDozYfDMSRLY1RkTkz0p5BHGgpr4qbx07PjqKw3nry+pUw+r+OTiN8rmQD5GlO935QTqZ4AGiknRY+hpA=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777558905;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=41rJ88/qqbQbj8PpLO3MOslw+MC7ab99VuFjzJguEX4=;\n b=Aag82AznfmfNu7O0MRSCdej/45oHvAuS7kknX+bN6WVAsmy2PS0Yd1+refN/jHoUQLafYy\n P/FOCsDRJ/uze7tIS9jWZFpdR6CVU+ESkkjaCBitf2p0BKRYnT40wprzjHvbhp3vZEoQ9c\n 0G/5O2eKrIaDeMSk8H+iNfu+lqnT1RE=", "X-MC-Unique": "sYcm-vJpPzOEj7DpL7bVrA-1", "X-Mimecast-MFC-AGG-ID": "sYcm-vJpPzOEj7DpL7bVrA_1777558902", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777558902; x=1778163702;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=41rJ88/qqbQbj8PpLO3MOslw+MC7ab99VuFjzJguEX4=;\n b=TLLdauv0bSF8+LP7M24mUg83K0vErFyzXT8okQLQlLMhdUdVFcLNDwjhIkGOq2+aJR\n 3cJfqp/Wees++Msh58QDcHxzvZiTOS541DBkaeYQYb+70QnUhzo0E/yC5Sv7TgvU0Tx9\n nsdgWUqRfCNlcIz/AtheHWK4fj09DP6o5ECACkWLIhzaqhVVM1+g1dtUf+7Gn56v4hvP\n 0SBqQQ5vA+CpXapJT+NRXqsjecccFJmKkZLFFSJMe3oy3vP/We4kRNRFERRpSBc0LvhC\n 1cgzHVM/ho+wC0+zR43DfPor5ce78X8I0rMmWb+Dam/Y6ogXeuu5KiGlmbRLJUNlYpje\n fMTw==", "X-Gm-Message-State": "AOJu0Yyp4oQDiKDBHWUShKPWF9dX6+nuB1MyQe0RtK/c+yGvFizm5vu6\n 1YnntB875V6Dkzj8GcRVjClGjoa9h6zad/29PLpegU6ScBxbvfJLwNsI8N2T1ZWUOVVMtUGuBz6\n 6hCQnq3HxsrT9OfL1d4KX+trwJoXSbdiboo7peupEz6erpuJou0JQjyL8u3HPFUJkKiNeVnjKVk\n km8sOl6LQmnkq53rPrQQhwVB64JxaNNvjdMwoqv3Nv", "X-Gm-Gg": "AeBDiesuYQvjdvTYUMttVsb1twcYHiwEwAjV9KZbc+qpEeBWio9ZisksPMUENWlGzz1\n 1mn6enMDcRRTF8EPry3YX3f06ByVgn0tbzqw0bDog9Ykzvp8v0dHW2G4fLdVg6Fkd3w7qtXOnKw\n Nss0w3zmv5xFkM+UbPik4WLklbrC7KR8CLHsq4thNtYVUP9UpCETaxuo9wajXT5Nef+1oNHDAQf\n +ly3WDy03n12w4veWcraaLCGZl9xmnL2reEwmMDt4yYru4v5c90iHim65b9vMVY/Tqo/HS7AWrZ\n d/VqSDaesbrp0WVKEAeFK3gdPAyuxanix95G5xSuFG2j1Z5fzrI6nxJs4/xmpforBbv4jmLUIok\n EQZWrmUzHTH1zxw7t/o5AOVw=", "X-Received": [ "by 2002:a05:622a:1f8c:b0:501:4767:a6f with SMTP id\n d75a77b69052e-5102adecb6emr29300771cf.3.1777558901614;\n Thu, 30 Apr 2026 07:21:41 -0700 (PDT)", "by 2002:a05:622a:1f8c:b0:501:4767:a6f with SMTP id\n d75a77b69052e-5102adecb6emr29299861cf.3.1777558900538;\n Thu, 30 Apr 2026 07:21:40 -0700 (PDT)" ], "From": "Patrick Palka <ppalka@redhat.com>", "To": "gcc-patches@gcc.gnu.org", "Cc": "jason@redhat.com,\n\tnshead@gcc.gnu.org,\n\tPatrick Palka <ppalka@redhat.com>", "Subject": "[PATCH] c++/modules: false positive abi_tag mismatch [PR124957]", "Date": "Thu, 30 Apr 2026 10:21:38 -0400", "Message-ID": "<20260430142138.1223368-1-ppalka@redhat.com>", "X-Mailer": "git-send-email 2.54.0.rc1.54.g60f07c4f5c", "MIME-Version": "1.0", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "5AZyFe8atIFadMgNerHAmMSx8KXGc0UDxst8-EwvAgM_1777558902", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "content-type": "text/plain; charset=\"US-ASCII\"; x-default=true", "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": "Tested on x86_64-pc-linux-gnu, does this look OK for trunk/16?\nAlternatively we could not mangle here and just silently accept the\nabi_tag mismatch if there's a mangled-ness mismatch; it feels\nsomewhat iffy to mangle something in the middle of streaming.\n\n-- >8 --\n\nHere x in _a.C is defined in terms of A, which has an abi_tag, so it\nshould inherit A's abi_tag. It turns out this abi_tag propagation\nhappens only during mangling via class.cc:check_abi_tags, and we happen\nto never mangle x in this TU, so we stream out x with no abi_tag.\n\nIn _b.C we import and re-export x, and we also happen to mangle x (for\narbitrary reasons that I didn't question), which means when we stream it\nout this time it has an abi_tag.\n\nIn _c.C we import both versions of x, merge them, during which we\ncompare their abi_tag, notice a mismatch, and diagnose. But the\nmismatch is solely due to one version (existing) being mangled, and\ntherefore went through class.cc:check_abi_tags, and the other (decl)\nnot.\n\nIdiosyncracies of this testcase aside (like why x gets mangled in _b.C,\nwhy we stream in two apparent x's in _c.C), it does seem like this\ndiagnostic routine should be robust to this situation. To that end this\npatch makes the routine mangle one of the decls as needed if there's\ninitially an apparent mismatch.\n\n\tPR c++/124957\n\ngcc/cp/ChangeLog:\n\n\t* module.cc (trees_in::check_abi_tags): If only one of the decls\n\tis mangled, ensure the other one is too before comparing.\n\ngcc/testsuite/ChangeLog:\n\n\t* g++.dg/modules/attrib-6_a.C: New test.\n\t* g++.dg/modules/attrib-6_b.C: New test.\n\t* g++.dg/modules/attrib-6_c.C: New test.\n---\n gcc/cp/module.cc | 12 ++++++++++++\n gcc/testsuite/g++.dg/modules/attrib-6_a.C | 10 ++++++++++\n gcc/testsuite/g++.dg/modules/attrib-6_b.C | 8 ++++++++\n gcc/testsuite/g++.dg/modules/attrib-6_c.C | 8 ++++++++\n 4 files changed, 38 insertions(+)\n create mode 100644 gcc/testsuite/g++.dg/modules/attrib-6_a.C\n create mode 100644 gcc/testsuite/g++.dg/modules/attrib-6_b.C\n create mode 100644 gcc/testsuite/g++.dg/modules/attrib-6_c.C", "diff": "diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc\nindex 49330312520e..dc9981a5fc24 100644\n--- a/gcc/cp/module.cc\n+++ b/gcc/cp/module.cc\n@@ -12537,6 +12537,18 @@ trees_in::check_abi_tags (tree existing, tree decl, tree &eattr, tree &dattr)\n if ((etags == nullptr) != (dtags == nullptr)\n || (etags && !attribute_value_equal (etags, dtags)))\n {\n+ if (DECL_ASSEMBLER_NAME_SET_P (STRIP_TEMPLATE (existing))\n+\t != DECL_ASSEMBLER_NAME_SET_P (STRIP_TEMPLATE (decl)))\n+\t{\n+\t /* abi_tag gets propagated from components of a decl to the decl\n+\t only during mangling, so ensure both decls are mangled before\n+\t comparing their abi_tags to avoid false positives. */\n+\t decl_assembler_name (STRIP_TEMPLATE (existing));\n+\t decl_assembler_name (STRIP_TEMPLATE (decl));\n+\t etags = lookup_attribute (\"abi_tag\", eattr);\n+\t dtags = lookup_attribute (\"abi_tag\", dattr);\n+\t}\n+\n if (etags)\n \tetags = TREE_VALUE (etags);\n if (dtags)\ndiff --git a/gcc/testsuite/g++.dg/modules/attrib-6_a.C b/gcc/testsuite/g++.dg/modules/attrib-6_a.C\nnew file mode 100644\nindex 000000000000..c63d2cd65c1e\n--- /dev/null\n+++ b/gcc/testsuite/g++.dg/modules/attrib-6_a.C\n@@ -0,0 +1,10 @@\n+// PR c++/124957\n+// { dg-do compile { target c++17 } }\n+// { dg-additional-options \"-fmodules\" }\n+\n+export module mod:partition;\n+\n+int dummy;\n+struct [[gnu::abi_tag(\"cxx11\")]] A { int m; };\n+export inline int A::*x = &A::m;\n+// x does not get mangled in this TU => abi_tag not propagated to x\ndiff --git a/gcc/testsuite/g++.dg/modules/attrib-6_b.C b/gcc/testsuite/g++.dg/modules/attrib-6_b.C\nnew file mode 100644\nindex 000000000000..c635e159b40b\n--- /dev/null\n+++ b/gcc/testsuite/g++.dg/modules/attrib-6_b.C\n@@ -0,0 +1,8 @@\n+// PR c++/124957\n+// { dg-do compile { target c++17 } }\n+// { dg-additional-options \"-fmodules\" }\n+\n+export module mod; // { dg-module-cmi \"mod\" }\n+export import :partition;\n+\n+// x gets mangled in this TU => abi_tag propagated to x\ndiff --git a/gcc/testsuite/g++.dg/modules/attrib-6_c.C b/gcc/testsuite/g++.dg/modules/attrib-6_c.C\nnew file mode 100644\nindex 000000000000..7bfa270f5b47\n--- /dev/null\n+++ b/gcc/testsuite/g++.dg/modules/attrib-6_c.C\n@@ -0,0 +1,8 @@\n+// PR c++/124957\n+// { dg-do compile { target c++17 } }\n+// { dg-additional-options \"-fmodules -fno-module-lazy\" }\n+\n+module mod;\n+import :partition;\n+\n+// no bogus abi_tag mismatch error for the imported x's\n", "prefixes": [] }