Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2218523/?format=api
{ "id": 2218523, "url": "http://patchwork.ozlabs.org/api/patches/2218523/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260401111446.148513-1-gonzalo.silvalde@gmail.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": "<20260401111446.148513-1-gonzalo.silvalde@gmail.com>", "list_archive_url": null, "date": "2026-04-01T11:14:46", "name": "[v2] fortran: Fix host association in module procedure interface bodies [PR79330]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "f4eaf3bda4764f38c0c1902fc777d26b02555497", "submitter": { "id": 92648, "url": "http://patchwork.ozlabs.org/api/people/92648/?format=api", "name": "Gonzalo Silvalde Blanco", "email": "gonzalo.silvalde@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260401111446.148513-1-gonzalo.silvalde@gmail.com/mbox/", "series": [ { "id": 498316, "url": "http://patchwork.ozlabs.org/api/series/498316/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=498316", "date": "2026-04-01T11:14:46", "name": "[v2] fortran: Fix host association in module procedure interface bodies [PR79330]", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/498316/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2218523/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2218523/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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=JnQEwxyg;\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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=JnQEwxyg", "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "sourceware.org; spf=pass smtp.mailfrom=gmail.com", "server2.sourceware.org;\n arc=none smtp.remote-ip=209.85.128.67" ], "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 4fm2VW0z5Gz1yCp\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 22:16:19 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 4CD7E4BA23E5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 1 Apr 2026 11:16:17 +0000 (GMT)", "from mail-wm1-f67.google.com (mail-wm1-f67.google.com\n [209.85.128.67])\n by sourceware.org (Postfix) with ESMTPS id CBF7D4BA23DF\n for <gcc-patches@gcc.gnu.org>; Wed, 1 Apr 2026 11:15:30 +0000 (GMT)", "by mail-wm1-f67.google.com with SMTP id\n 5b1f17b1804b1-486fb439299so63206425e9.0\n for <gcc-patches@gcc.gnu.org>; Wed, 01 Apr 2026 04:15:30 -0700 (PDT)", "from gonzalo.cinfo.lan ([178.60.12.162])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43cf245f87esm33280644f8f.22.2026.04.01.04.15.28\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 01 Apr 2026 04:15:29 -0700 (PDT)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 4CD7E4BA23E5", "OpenDKIM Filter v2.11.0 sourceware.org CBF7D4BA23DF" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org CBF7D4BA23DF", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org CBF7D4BA23DF", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775042131; cv=none;\n b=nj0BeYGz9kx0Pt32bYpZNorzapnTV7+pDk3NThxjtllTUSDT01tJ9BkI4sddrLkJLgiVxjV7oSJMWAleJ5zZIxlhxIqjYco9YWbxBYr2ubig9BGYmuTIBxPoyUsE9TtVP+fVUpGWophwSIUfljZtjJJmWY2jWmh2e1gzlApVB4A=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775042131; c=relaxed/simple;\n bh=t2Aij1AwPR1uUMaXX1QHhxP1w+yxLIAVgDqUYxJmb+k=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=MNNRL+YHmgsFKvvFKD27bmYIpBJP3cpfN39LEqpAjSqvmYRObboWbQvo9U6+GaVRzaGVcdLiTYEEm4YP4wnPTQwtt7sbwqgjpcnbbhAu8OmBZ/LFG0eAZ43Z5P/1KjCa1jYncLVOl7BacYUpRpf3iiSrNyOyn38WDvwXuFTqctY=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775042130; x=1775646930; 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=aU0mJlTzRCrfMwmgBBnEbHZ+UweRIU8IbDiA73gc5PI=;\n b=JnQEwxygK9xHDUISzXQVd4LZlraw746a49p/h738WKOs4LeqW0gsX49xEZqjSq5DvQ\n T/etPLLxoCzewwuKV+N8qpUSJaeuLcjjvVwhaAWwcPviRgnr1Ii46KsRTRqVV3SOsi1p\n xgt425/ly+nv0ISMG5oaptDHbPHjLswR9quebgpE7MJVTK8PW4lceuMwCyuO+BKdOaJp\n Hf3fBvOoimTustOd+h06YnlS51QwXli/R+4Lj5nTaJpurMjasxFFm5xLmpNgljnsf4pI\n +yFNFSTSkGvpdeGDjTNz1jfM3LWVIN/+iCS8F+Xlfcg+GyOEYk4JTHFQDHNSLfhf3lAq\n ef1Q==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775042130; x=1775646930;\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=aU0mJlTzRCrfMwmgBBnEbHZ+UweRIU8IbDiA73gc5PI=;\n b=tM27ja2PVge26j9+MmpOLzjrcv5NmduwIiHpWHZUCKPpHqAm6YhH0kKqrtoxc8Hc6I\n SoU3ab4ojFy07IxjVWGqRrqUcfVNUmv0+YdSAoUw4cHS980YJwTeSAQbNpXvPLSoIuF1\n vIeeIL25CddtTduw+uZs2C+wcq8eFV1ejP2HQuqMcJGa2EM/jH+5yZRG3KxPdOCZZAYU\n 7tpH8/+Kjf843kaKvNReFtl1xKv8xI8FOK5pDEcMqbrZ2ND/wOWDmUnNahG8yAK2u4Kd\n EdUtgm/Iw2ZK4jrUQuDjV+RFitjOgIapufINMkCUc0rYYNBT1+2oo30d7yA4zIgcT+HS\n 3EWw==", "X-Gm-Message-State": "AOJu0YyNbpVGZtiAkYdRZrjzeTYmejtEDPzKlUqz1RnvyV7iIev903lt\n kDd5ozaV9TxXR4msA4zhlEvb3YcB+r509KGmaGc2gUT9Uagy83e9UDmLnW4aw/tO", "X-Gm-Gg": "ATEYQzyO7HvW++oJBnDnKXoBWZhg1p1fbf6SV6lSB+xhGLGJdO8/ZCiSSImtc4Ovwvu\n LfP59TQ2Z65ynkLWdMTQoorRswWCsAma4eWOlyamGwCgVT59NV5yIpC+FZ0wq9eDBxGSSft7yQg\n 0L1Liij8Jx26OiaTaQod2UsFR2qrVnra41h2STgGW9xPEAdzteIFKGLmx+PGxpk1kNra6Ny8TaB\n EbeBmwlDQ7aRUDH15hHhFFtZf75xw5UDdpCjsV+wkkYQODXrmGpjiW+Kh5EQupps4SxxOb/hEht\n bw8A0NK2J2xETgu4W/8EFrLiyGNkGBWSoxJWS7xEP73eU4oqJIq5hmL/UldqixUVOqQPas7uDjd\n LoDtCwAnXv5leHc3qhYMBqEIaOvtHAhlMsdaEZ4venvoARbMNxf1V5CgWjkrGVYU1XfdnT1ze7B\n nekY948wwFQtTvcfpAPO2FI/F9zpE9bRMxdN/xVQ==", "X-Received": "by 2002:a05:600c:354d:b0:487:386:3714 with SMTP id\n 5b1f17b1804b1-48883597e29mr49040285e9.17.1775042129452;\n Wed, 01 Apr 2026 04:15:29 -0700 (PDT)", "From": "Gonzalo Silvalde <gonzalo.silvalde@gmail.com>", "To": "gcc-patches@gcc.gnu.org", "Cc": "fortran@gcc.gnu.org, anlauf@gmx.de,\n Gonzalosilvalde <gonzalo.silvalde@gmail.com>", "Subject": "[PATCH v2] fortran: Fix host association in module procedure\n interface bodies [PR79330]", "Date": "Wed, 1 Apr 2026 13:14:46 +0200", "Message-ID": "<20260401111446.148513-1-gonzalo.silvalde@gmail.com>", "X-Mailer": "git-send-email 2.47.3", "In-Reply-To": "<dc3188d3-69ad-4319-88cb-bd852313c048@gmx.de>", "References": "<dc3188d3-69ad-4319-88cb-bd852313c048@gmx.de>", "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": "From: Gonzalosilvalde <gonzalo.silvalde@gmail.com>\n\nNamed constants from the host scope were not accessible in module\nprocedure interface bodies, causing bind(C, name=...) expressions\nreferencing such constants to fail. The compiler treated the constant\nas an implicitly typed REAL(4) variable instead of resolving it from\nthe enclosing module scope.\n\nThe fix sets has_import_set on the current namespace when a module\nprocedure is detected inside an interface block, before bind(C) is\nparsed, so that symbol lookup can reach the host scope.\n\ngcc/fortran/ChangeLog:\n\n\tPR fortran/79330\n\t* decl.cc (gfc_match_subroutine): Set has_import_set when\n\tmatching a module procedure inside an interface block.\n\t(gfc_match_function_decl): Likewise.\n\ngcc/testsuite/ChangeLog:\n\n\tPR fortran/79330\n\t* gfortran.dg/bind_c_module_proc.f90: New test.\n\nSigned-off-by: Gonzalo Silvalde <gonzalo.silvalde@gmail.com>\n---\n gcc/fortran/decl.cc | 12 ++++++++++--\n .../gfortran.dg/bind_c_module_proc.f90 | 18 ++++++++++++++++++\n 2 files changed, 28 insertions(+), 2 deletions(-)\n create mode 100644 gcc/testsuite/gfortran.dg/bind_c_module_proc.f90", "diff": "diff --git a/gcc/fortran/decl.cc b/gcc/fortran/decl.cc\nindex 454b65f2c47..faf404d994a 100644\n--- a/gcc/fortran/decl.cc\n+++ b/gcc/fortran/decl.cc\n@@ -8191,7 +8191,11 @@ gfc_match_function_decl (void)\n sym = sym->result;\n \n if (current_attr.module_procedure)\n- sym->attr.module_procedure = 1;\n+ {\n+ sym->attr.module_procedure = 1;\n+ if (gfc_current_state () == COMP_INTERFACE)\n+ gfc_current_ns->has_import_set = 1;\n+ }\n \n gfc_new_block = sym;\n \n@@ -8687,7 +8691,11 @@ gfc_match_subroutine (void)\n \t\t\t\t\t &gfc_current_locus);\n \n if (current_attr.module_procedure)\n- sym->attr.module_procedure = 1;\n+ {\n+ sym->attr.module_procedure = 1;\n+ if (gfc_current_state () == COMP_INTERFACE)\n+ gfc_current_ns->has_import_set = 1;\n+ }\n \n if (add_hidden_procptr_result (sym))\n sym = sym->result;\ndiff --git a/gcc/testsuite/gfortran.dg/bind_c_module_proc.f90 b/gcc/testsuite/gfortran.dg/bind_c_module_proc.f90\nnew file mode 100644\nindex 00000000000..2df933f3c14\n--- /dev/null\n+++ b/gcc/testsuite/gfortran.dg/bind_c_module_proc.f90\n@@ -0,0 +1,18 @@\n+! { dg-do compile }\n+! PR fortran/79330\n+! Verify that named constants from the host scope are accessible\n+! in module procedure interface bodies for bind(C, name=...).\n+\n+module m\n+ implicit none\n+ character(len=*), parameter :: PREFIX = \"_gfortran_\"\n+ interface\n+ module subroutine sub() bind(C, name=PREFIX//\"caf_sub\")\n+ implicit none\n+ end subroutine\n+ module function func() result(r) bind(C, name=PREFIX//\"caf_func\")\n+ implicit none\n+ integer :: r\n+ end function\n+ end interface\n+end module\n", "prefixes": [ "v2" ] }