{"id":2222221,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2222221/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/6369a135-75fd-4108-88f2-7aca575d05af@gmail.com/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/1.1/projects/17/?format=json","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":"<6369a135-75fd-4108-88f2-7aca575d05af@gmail.com>","date":"2026-04-10T21:23:01","name":"[fortran] Fix Bug 93814 - [13/14/15/16 Regression] ICE in build_entry_thunks ...","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"39a3539ed42db1e29bf4cfeecb8480a07e06170d","submitter":{"id":78264,"url":"http://patchwork.ozlabs.org/api/1.1/people/78264/?format=json","name":"Jerry D","email":"jvdelisle2@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/6369a135-75fd-4108-88f2-7aca575d05af@gmail.com/mbox/","series":[{"id":499512,"url":"http://patchwork.ozlabs.org/api/1.1/series/499512/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=499512","date":"2026-04-10T21:23:01","name":"[fortran] Fix Bug 93814 - [13/14/15/16 Regression] ICE in build_entry_thunks ...","version":1,"mbox":"http://patchwork.ozlabs.org/series/499512/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2222221/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2222221/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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=igKLQ0Ye;\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=igKLQ0Ye","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.210.172"],"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 4fsqY42rfWz1yGb\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Apr 2026 07:23:34 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 5D96C4BA23D0\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 21:23:32 +0000 (GMT)","from mail-pf1-f172.google.com (mail-pf1-f172.google.com\n [209.85.210.172])\n by sourceware.org (Postfix) with ESMTPS id EF2D24BA2E18\n for <gcc-patches@gcc.gnu.org>; Fri, 10 Apr 2026 21:23:03 +0000 (GMT)","by mail-pf1-f172.google.com with SMTP id\n d2e1a72fcca58-82c68339cf0so1508173b3a.0\n for <gcc-patches@gcc.gnu.org>; Fri, 10 Apr 2026 14:23:03 -0700 (PDT)","from [10.168.168.23] ([50.37.179.80])\n by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-82f0c20aed6sm3835424b3a.0.2026.04.10.14.23.01\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Fri, 10 Apr 2026 14:23:01 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 5D96C4BA23D0","OpenDKIM Filter v2.11.0 sourceware.org EF2D24BA2E18"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org EF2D24BA2E18","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org EF2D24BA2E18","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775856184; cv=none;\n b=QFGCtl7Twu723YpTw+/i7Y5e/FnkpBS9e88XfvnSzmgwDjaQoHv3bi2Xu6NphnHQWff8IekVbAoUVWMJh1EJnU3s3bgc3G9b5KrwM2CBtM0NMVUY7UkqY5pLhGzC/uiIv3Kr0GpsdRpyDLYQbGnQAV4IZIM9nAvX+WfF0WK3FXY=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775856184; c=relaxed/simple;\n bh=GVSq8bfJ1gAjTdAfXbNDWp9LAG50mSwDVD/srJE4udA=;\n h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject;\n b=bS39YWMKSj+2jr8eYFEnYyvoczBkYfnq7IcyJY/Q6iOUR4cCaDR25yix1Fb6TxmkX8Gkzkh0MSeB6F0PJboPUnpodoTvvxFrrifqhEQPNtDrsqzSzGzYZuIpqeco9mxxxFPqqS4ywtOWV38d4w9whqgH1eBCndo7t9rVG/hKzaI=","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=1775856183; x=1776460983; darn=gcc.gnu.org;\n h=autocrypt:subject:from:cc:to:content-language:user-agent\n :mime-version:date:message-id:from:to:cc:subject:date:message-id\n :reply-to; bh=sE7JHH96Ma0cFleTwud1P5K0uJG7I/LUxtTfud/pnkc=;\n b=igKLQ0Yeoi/qnpSqhQ+T1GWIcoYiZhqJVD+0lAvruQDaw1IfARTfdGDBOHWV7ycveD\n C7bkRn1i/lvA5vK+4k1+9O2PnRe3ZHwHGWVj+158mYHS6IzHg+gBcxL5fl2al2Lt82Le\n h5Xj39mqKnt5TuuVOjDrvnFQPG360hmev7eouSraLcO/QQ1aZdRQesRxioF3j5X3xwHi\n m9s9wd1hi8an0tSSFVc+BpsqHIyKoairs8g3ks2RhBIWDd6oDuK2EZL8fMEEWH/EDKPc\n mKeHzQEDEtZe4TVOf79jZmXE6qJz9XwsjRnlmKL0hwuKUITEgZmls0IZfXF4hxVh7rZp\n EEmw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775856183; x=1776460983;\n h=autocrypt:subject:from:cc:to:content-language:user-agent\n :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=sE7JHH96Ma0cFleTwud1P5K0uJG7I/LUxtTfud/pnkc=;\n b=doPBrkqcZYb4FfrbpIb0okvuzTncn7zMVT1H7P8ZZIVEaYRm8bpbDQoiDUm5FVs9Cv\n Rxug+MRtdx4fdbTMcgWdK5xuP4qSCG6PagGlmgYpYqvv9r88XToTwfujhqYdfa9VDejC\n z4SrNo4j+yolODDDrRTC8Jvbn7/o/FsxxE1//xGYVEMmceh+8xKof9lVe5kSBLJXhOsD\n ow45B9K/2Up+f8M7qU++grV+h1WKhe4s2gj+u1QCpXD38Xh+w+63TOY3RSnQQDoQHKcT\n jgkA6kDWKFVtTl0KrHQ1o/r5ODd+Q2nS6IwbEsPoCQEUPCi/eY2NjNYDy8OoHrZOsOJE\n ixPA==","X-Forwarded-Encrypted":"i=1;\n AJvYcCWV1kc3ji0Bicn7YBYd9Ya/LVR/V6kaGRNvqukaxPIr3c1fX+/QoT5Z0ej4OPCVz6tP9Lqkufk1CRarNQ==@gcc.gnu.org","X-Gm-Message-State":"AOJu0YzbxnHP+4dP+DsaI/Ze6eKh7DeiH8rMCvlfaVzRM0nC5grRBc00\n cHsSunV62os2i9dR1TxuiL/tUt50zE3YwB3fFDb9B7ou3IOHyQzPb8Ss","X-Gm-Gg":"AeBDietQhMs5uo3lAGbxw7K/yBqUEqhP79OuqdwMfEZ60ofD04wOdKqU4kP3KCeFard\n dK35nbG/6X7XeN1Go/OLnSJsAY1gXGfiLw4s+KHUd6QvNBrKR4ENXl2byS0CaXS+jVoZ+CBCLot\n 9QAk0ksNC0HOgO4kXTqsypSGCVFK50lmJlRdKtUicvmT5oqvUXVNfJCuMLta70F4a9wB6CXFb/v\n OTq1GjBmjCC8cA4xoVFmgN+m3YHLK5mSCSKH7wGHPSYnOIYhYLvxFfcBJjL6oIUYwTubDMeusRp\n zmqEi3iBY9ZmWb82muy1DtDPWxqsU3oFSLydSRxhcdSd3oOSezUKwqqT04iD20EUKm2d/3g/68e\n ZpJ4tqubhjurA3TFefirZCY35ZzGa05cBNZizc5ko0pd9V9BMAqg+EWSX09yxYylYsUyhOOyAbQ\n B2P/tp3br8PT23UBY0fJkq99pPYo0=","X-Received":"by 2002:a05:6a00:23d4:b0:7e8:3fcb:9b03 with SMTP id\n d2e1a72fcca58-82dd8b5de79mr7589692b3a.25.1775856182668;\n Fri, 10 Apr 2026 14:23:02 -0700 (PDT)","Content-Type":"multipart/mixed; boundary=\"------------3D205GdppPFCBydfUi22HzzN\"","Message-ID":"<6369a135-75fd-4108-88f2-7aca575d05af@gmail.com>","Date":"Fri, 10 Apr 2026 14:23:01 -0700","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Content-Language":"en-US","To":"gfortran <fortran@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>","Cc":"Paul Richard Thomas <paul.richard.thomas@gmail.com>,\n Christopher Albert <albert@tugraz.at>","From":"Jerry D <jvdelisle2@gmail.com>","Subject":"[PATCH,fortran] Fix Bug 93814 - [13/14/15/16 Regression] ICE in\n build_entry_thunks ...","Autocrypt":"addr=jvdelisle2@gmail.com; keydata=\n xjMEY5TlkxYJKwYBBAHaRw8BAQdAyrkRDhmJhSTTlV/50gJLlvliU6/Lm5C9ViKV8T9y1GnN\n HkplcnJ5IEQgPGp2ZGVsaXNsZTJAZ21haWwuY29tPsKJBBMWCAAxFiEEOFR0TS0390uh8dRV\n uWXAJaWpwWoFAmOU5ZMCGwMECwkIBwUVCAkKCwUWAgMBAAAKCRC5ZcAlpanBalsJAP4wdCiH\n 2Of9oZv1QWgZ/AVdbWFM3Fv47/WZQHOXfoZ9HgD6AkXrKeJ+6usST7PEaDJjptaViT1fLiYY\n V/6XaOKSsgLOOARjlOWTEgorBgEEAZdVAQUBAQdAdA7PczYnl07vnOT9oP/wvvMDd4HP09Zl\n g3LzwXQJWT8DAQgHwngEGBYIACAWIQQ4VHRNLTf3S6Hx1FW5ZcAlpanBagUCY5TlkwIbDAAK\n CRC5ZcAlpanBasF/AQCa5WjlsVpLsEiggZyT18MOJNAdeRd7wkGDUrwedHrvawD/cE1H+/Ms\n L1ZwvQiLfGdx8crigQqWTQyos4kH8Wx82wc=","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 all,\n\nThe attached patch from Christopher regression tested OK here.\n\nI also compared results to other compilers. I think it is OK.\n\nTested on x86_64.\n\nOK to commit to mainline and backport later after things have settled a bit.\n\nRegards,\n\nJerry\n---\n\nfortran: Fix ICE in build_entry_thunks with CHARACTER bind(c)\n  ENTRY [PR93814]\n\nWhen a CHARACTER function with bind(c) has an ENTRY also with bind(c),\nthe entry master function returns CHARACTER by reference (void return,\nresult passed as pointer + length arguments), but the individual bind(c)\nentry thunks return CHARACTER(1) by value and have no such arguments.\n\nbuild_entry_thunks unconditionally forwarded result-reference arguments\nfrom the thunk's own parameter list to the master call.  For bind(c)\nCHARACTER thunks this accessed DECL_ARGUMENTS of a function with no\narguments, causing a segfault.\n\nCreate local temporaries for the result buffer and character length in\nthe thunk when the master returns by reference but the thunk does not.\nAfter calling the master (which writes through the reference), load\nthe character value from the local buffer and return it by value.\n\n\tPR fortran/93814\n\ngcc/fortran/ChangeLog:\n\n\t* trans-decl.cc (build_entry_thunks): Create local result buffer\n\tand length temporaries for bind(c) CHARACTER entry thunks when the\n\tmaster returns by reference but the thunk returns by value.\n\ngcc/testsuite/ChangeLog:\n\n\t* gfortran.dg/pr93814.f90: New test.\n\nSigned-off-by: Christopher Albert <albert@tugraz.at>","diff":"From 2d0dca791712599d549952a377d6b91cbe0eaf80 Mon Sep 17 00:00:00 2001\nFrom: Christopher Albert <albert@tugraz.at>\nDate: Tue, 31 Mar 2026 08:45:28 +0200\nSubject: [PATCH] fortran: Fix ICE in build_entry_thunks with CHARACTER bind(c)\n ENTRY [PR93814]\n\nWhen a CHARACTER function with bind(c) has an ENTRY also with bind(c),\nthe entry master function returns CHARACTER by reference (void return,\nresult passed as pointer + length arguments), but the individual bind(c)\nentry thunks return CHARACTER(1) by value and have no such arguments.\n\nbuild_entry_thunks unconditionally forwarded result-reference arguments\nfrom the thunk's own parameter list to the master call.  For bind(c)\nCHARACTER thunks this accessed DECL_ARGUMENTS of a function with no\narguments, causing a segfault.\n\nCreate local temporaries for the result buffer and character length in\nthe thunk when the master returns by reference but the thunk does not.\nAfter calling the master (which writes through the reference), load\nthe character value from the local buffer and return it by value.\n\n\tPR fortran/93814\n\ngcc/fortran/ChangeLog:\n\n\t* trans-decl.cc (build_entry_thunks): Create local result buffer\n\tand length temporaries for bind(c) CHARACTER entry thunks when the\n\tmaster returns by reference but the thunk returns by value.\n\ngcc/testsuite/ChangeLog:\n\n\t* gfortran.dg/pr93814.f90: New test.\n\nSigned-off-by: Christopher Albert <albert@tugraz.at>\n---\n gcc/fortran/trans-decl.cc             | 68 +++++++++++++++++-\n gcc/testsuite/gfortran.dg/pr93814.f90 | 99 +++++++++++++++++++++++++++\n 2 files changed, 164 insertions(+), 3 deletions(-)\n create mode 100644 gcc/testsuite/gfortran.dg/pr93814.f90\n\ndiff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc\nindex 0080e83fc36..3e60fb41f12 100644\n--- a/gcc/fortran/trans-decl.cc\n+++ b/gcc/fortran/trans-decl.cc\n@@ -3129,15 +3129,60 @@ build_entry_thunks (gfc_namespace * ns, bool global)\n       tmp = build_int_cst (gfc_array_index_type, el->id);\n       vec_safe_push (args, tmp);\n \n-      if (thunk_sym->attr.function)\n+      /* When the master returns by reference, pass the result reference\n+\t and (for CHARACTER) the string length to the master call.  If the\n+\t thunk itself also returns by reference these are forwarded from\n+\t its own argument list; otherwise (bind(c) CHARACTER entry) we\n+\t create local temporaries and load the value after the call.  */\n+      tree result_ref = NULL_TREE;\n+      if (thunk_sym->attr.function\n+\t  && gfc_return_by_reference (ns->proc_name))\n \t{\n-\t  if (gfc_return_by_reference (ns->proc_name))\n+\t  if (gfc_return_by_reference (thunk_sym))\n \t    {\n \t      tree ref = DECL_ARGUMENTS (current_function_decl);\n \t      vec_safe_push (args, ref);\n \t      if (ns->proc_name->ts.type == BT_CHARACTER)\n \t\tvec_safe_push (args, DECL_CHAIN (ref));\n \t    }\n+\t  else\n+\t    {\n+\t      /* The thunk is bind(c) and returns CHARACTER by value, but\n+\t\t the master returns by reference.  Create a local buffer\n+\t\t and length to pass to the master call.  */\n+\t      tree chartype = gfc_get_char_type (thunk_sym->ts.kind);\n+\t      tree len;\n+\n+\t      if (thunk_sym->ts.u.cl && thunk_sym->ts.u.cl->length)\n+\t\t{\n+\t\t  gfc_se se;\n+\t\t  gfc_init_se (&se, NULL);\n+\t\t  gfc_conv_expr (&se, thunk_sym->ts.u.cl->length);\n+\t\t  gfc_add_block_to_block (&body, &se.pre);\n+\t\t  len = se.expr;\n+\t\t  gfc_add_block_to_block (&body, &se.post);\n+\t\t}\n+\t      else\n+\t\tlen = build_int_cst (gfc_charlen_type_node, 1);\n+\n+\t      result_ref = build_decl (input_location, VAR_DECL,\n+\t\t\t\t       get_identifier (\"__entry_result\"),\n+\t\t\t\t       build_array_type (chartype,\n+\t\t\t\t\t build_range_type (gfc_array_index_type,\n+\t\t\t\t\t   gfc_index_one_node,\n+\t\t\t\t\t   fold_convert (gfc_array_index_type,\n+\t\t\t\t\t\t\t len))));\n+\t      DECL_ARTIFICIAL (result_ref) = 1;\n+\t      TREE_USED (result_ref) = 1;\n+\t      DECL_CONTEXT (result_ref) = current_function_decl;\n+\t      layout_decl (result_ref, 0);\n+\t      pushdecl (result_ref);\n+\n+\t      vec_safe_push (args,\n+\t\t\t     build_fold_addr_expr_loc (input_location,\n+\t\t\t\t\t\t       result_ref));\n+\t      vec_safe_push (args, len);\n+\t    }\n \t}\n \n       for (formal = gfc_sym_get_dummy_args (ns->proc_name); formal;\n@@ -3184,7 +3229,24 @@ build_entry_thunks (gfc_namespace * ns, bool global)\n       vec_safe_splice (args, string_args);\n       tmp = ns->proc_name->backend_decl;\n       tmp = build_call_expr_loc_vec (input_location, tmp, args);\n-      if (ns->proc_name->attr.mixed_entry_master)\n+      if (result_ref != NULL_TREE)\n+\t{\n+\t  /* The master returns by reference (void) but the bind(c) thunk\n+\t     returns CHARACTER by value.  Execute the master call, then\n+\t     load the first character from the local buffer.  */\n+\t  gfc_add_expr_to_block (&body, tmp);\n+\t  tmp = build4_loc (input_location, ARRAY_REF,\n+\t\t\t    TREE_TYPE (TREE_TYPE (result_ref)),\n+\t\t\t    result_ref, gfc_index_one_node,\n+\t\t\t    NULL_TREE, NULL_TREE);\n+\t  tmp = fold_convert (TREE_TYPE (DECL_RESULT (current_function_decl)),\n+\t\t\t      tmp);\n+\t  tmp = fold_build2_loc (input_location, MODIFY_EXPR,\n+\t\t\t     TREE_TYPE (DECL_RESULT (current_function_decl)),\n+\t\t\t     DECL_RESULT (current_function_decl), tmp);\n+\t  tmp = build1_v (RETURN_EXPR, tmp);\n+\t}\n+      else if (ns->proc_name->attr.mixed_entry_master)\n \t{\n \t  tree union_decl, field;\n \t  tree master_type = TREE_TYPE (ns->proc_name->backend_decl);\ndiff --git a/gcc/testsuite/gfortran.dg/pr93814.f90 b/gcc/testsuite/gfortran.dg/pr93814.f90\nnew file mode 100644\nindex 00000000000..fb28e3f2215\n--- /dev/null\n+++ b/gcc/testsuite/gfortran.dg/pr93814.f90\n@@ -0,0 +1,99 @@\n+! { dg-do run }\n+!\n+! PR fortran/93814 - ICE in build_entry_thunks with CHARACTER ENTRY\n+! and bind(c).\n+!\n+! Verify that CHARACTER function results with ENTRY and bind(c) compile\n+! and execute correctly, covering all combinations of bind(c) on the\n+! function and its entries.\n+\n+! Both function and entry have bind(c).\n+function f1() bind(c)\n+  character :: f1, g1\n+  f1 = \"a\"\n+  return\n+  entry g1() bind(c)\n+  g1 = \"b\"\n+end\n+\n+! Only function has bind(c), entry does not.\n+function f2() bind(c)\n+  character(1) :: f2, g2\n+  f2 = \"c\"\n+  return\n+  entry g2()\n+  g2 = \"d\"\n+end function\n+\n+! Only entry has bind(c), function does not.\n+function f3()\n+  character(1) :: f3, g3\n+  f3 = \"e\"\n+  return\n+  entry g3() bind(c)\n+  g3 = \"f\"\n+end function\n+\n+! Neither function nor entry have bind(c) (baseline).\n+function f4()\n+  character :: f4, g4\n+  f4 = \"g\"\n+  return\n+  entry g4()\n+  g4 = \"h\"\n+end\n+\n+! Integer with bind(c) (should still work).\n+function f5() bind(c)\n+  integer :: f5, g5\n+  f5 = 42\n+  return\n+  entry g5() bind(c)\n+  g5 = 84\n+end\n+\n+program p\n+  interface\n+    function f1() bind(c)\n+      character :: f1\n+    end\n+    function g1() bind(c)\n+      character :: g1\n+    end\n+    function f2() bind(c)\n+      character(1) :: f2\n+    end\n+    function g2()\n+      character(1) :: g2\n+    end\n+    function f3()\n+      character(1) :: f3\n+    end\n+    function g3() bind(c)\n+      character(1) :: g3\n+    end\n+    function f4()\n+      character :: f4\n+    end\n+    function g4()\n+      character :: g4\n+    end\n+    function f5() bind(c)\n+      integer :: f5\n+    end\n+    function g5() bind(c)\n+      integer :: g5\n+    end\n+  end interface\n+\n+  if (f1() /= \"a\") stop 1\n+  if (g1() /= \"b\") stop 2\n+  if (f2() /= \"c\") stop 3\n+  if (g2() /= \"d\") stop 4\n+  if (f3() /= \"e\") stop 5\n+  if (g3() /= \"f\") stop 6\n+  if (f4() /= \"g\") stop 7\n+  if (g4() /= \"h\") stop 8\n+  if (f5() /= 42)  stop 9\n+  if (g5() /= 84)  stop 10\n+end\n-- \n2.53.0\n\n","prefixes":["fortran"]}