[{"id":3676119,"web_url":"http://patchwork.ozlabs.org/comment/3676119/","msgid":"<CAGkQGiLdie+7sThthGMUv4OSq5iuRn=-ep7y2rNK3mdSqHS77w@mail.gmail.com>","list_archive_url":null,"date":"2026-04-11T07:12:54","subject":"Re: [PATCH,fortran] Fix Bug 93814 - [13/14/15/16 Regression] ICE in\n build_entry_thunks ...","submitter":{"id":4392,"url":"http://patchwork.ozlabs.org/api/people/4392/","name":"Paul Richard Thomas","email":"paul.richard.thomas@gmail.com"},"content":"Hi Jerry,\n\nPlease accept my apologies. I became so obsessed with the final\nwrinkle in PR120140 that I stopped the regression fixes in the middle\nof processing PR93814. I have tested it and given it a good once over.\nIt is certainly ready for mainline; so please go ahead.\n\nRegards\n\nPaul\n\nOn Fri, 10 Apr 2026 at 22:23, Jerry D <jvdelisle2@gmail.com> wrote:\n>\n> Hi all,\n>\n> The attached patch from Christopher regression tested OK here.\n>\n> I also compared results to other compilers. I think it is OK.\n>\n> Tested on x86_64.\n>\n> OK to commit to mainline and backport later after things have settled a bit.\n>\n> Regards,\n>\n> Jerry\n> ---\n>\n> fortran: Fix ICE in build_entry_thunks with CHARACTER bind(c)\n>   ENTRY [PR93814]\n>\n> When a CHARACTER function with bind(c) has an ENTRY also with bind(c),\n> the entry master function returns CHARACTER by reference (void return,\n> result passed as pointer + length arguments), but the individual bind(c)\n> entry thunks return CHARACTER(1) by value and have no such arguments.\n>\n> build_entry_thunks unconditionally forwarded result-reference arguments\n> from the thunk's own parameter list to the master call.  For bind(c)\n> CHARACTER thunks this accessed DECL_ARGUMENTS of a function with no\n> arguments, causing a segfault.\n>\n> Create local temporaries for the result buffer and character length in\n> the thunk when the master returns by reference but the thunk does not.\n> After calling the master (which writes through the reference), load\n> the character value from the local buffer and return it by value.\n>\n>         PR fortran/93814\n>\n> gcc/fortran/ChangeLog:\n>\n>         * trans-decl.cc (build_entry_thunks): Create local result buffer\n>         and length temporaries for bind(c) CHARACTER entry thunks when the\n>         master returns by reference but the thunk returns by value.\n>\n> gcc/testsuite/ChangeLog:\n>\n>         * gfortran.dg/pr93814.f90: New test.\n>\n> Signed-off-by: Christopher Albert <albert@tugraz.at>","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=NNmp7fII;\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=NNmp7fII","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=pass smtp.remote-ip=74.125.82.45"],"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 4ft4f31PxMz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Apr 2026 17:13:45 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id DF25E4BA23DF\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Apr 2026 07:13:43 +0000 (GMT)","from mail-dl1-f45.google.com (mail-dl1-f45.google.com\n [74.125.82.45])\n by sourceware.org (Postfix) with ESMTPS id 3FCEC4BA2E0F\n for <gcc-patches@gcc.gnu.org>; Sat, 11 Apr 2026 07:13:07 +0000 (GMT)","by mail-dl1-f45.google.com with SMTP id\n a92af1059eb24-12c287eb77fso382141c88.1\n for <gcc-patches@gcc.gnu.org>; Sat, 11 Apr 2026 00:13:07 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org DF25E4BA23DF","OpenDKIM Filter v2.11.0 sourceware.org 3FCEC4BA2E0F"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 3FCEC4BA2E0F","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 3FCEC4BA2E0F","ARC-Seal":["i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1775891587; cv=pass;\n b=fskAkncErsWuL8QcW8oEgVDN63/lO/Ud2Jjka5hQj4X5cHotEkESvDJlHlMKdfNxJ8a/kPUxG0BZ9u79waIaWepPvyfXfljt7Aa+9831A74mlWkKXebzoBulGLD69P+UCqG59ponqrb0VrRkCTKisiC4//lrZYno+ix4RyG1crQ=","i=1; a=rsa-sha256; t=1775891586; cv=none;\n d=google.com; s=arc-20240605;\n b=RBWQ/95W+KX+06JCb7eIliZf1U2GyoEGck0/YRqu30FKtwzqwIkkAPxN2k9eO9JmaJ\n u3BsTBlkTOGVqJd3VVJ2gzQf+yhUV+UPK6d1Wh/pwCAYtG/MS1j4vevkqHexQ4U51Y0x\n 9HmpdXW7biP77ia7UxHMII/CAGCaPoTUucf+lRDI9O/SBLRz/oP5ynwdB7HDXtsP2igz\n ymp804N8sRdirgZvx0XF9KQWBlUNawD3YppaYap/62XnHCFLEilEcsjdD+SJ+FIsqnXz\n obw2FBh6LLGeNdlr8xmMWOwczpmPXLEJGGfgIqJDtfZhG5g7OfRucjKmt4TKVKfhx6hk\n ziTA=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775891587; c=relaxed/simple;\n bh=7Sg4aW2RgQzBE5v0QUhQbCADESswMU2e2TQVGRqp8Z0=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=cQt3++VQDy4W7hLGUn1+fFx8BiUDudLfB6tCq8Lpr1Kb9U+bely5oU6mAQXYT8b57zM4ugcetuf5VoeZkJer/+Pqe7nKt3hfORzR8984gY6Eycj6k0xAKbiso2ale8T81XPv+Wjtr9qhTFiO94D7VKUOOFI9rTbeQo3eC2MreEk=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=pUeYEz4jTMorEmbfqK3Wr1E0Z/LEnPZ7ZO2w39bI2cY=;\n fh=cbPOIoTj9ujqv6dVC+kx5wbrXQt84Jm1j9QtIy9DFCA=;\n b=ahLdQW/cwi3+eEIkH0D8voRaiNAqS/14BrsIb+LE7mo6A9N+8KofHzd3hOg9zpLoln\n W2/ykrjn1yf3rclkUKk2LftlEJuRReaf1Ibi91YF50i2BCGYJzFR4Sd6PNXVfS4pp13g\n ChZCwDttEUrQ1cYdRrpnG9zgSRIBFqIt3qSFCWZ5MT1X68JKeCYbQukYMsHU52cv8xB+\n RAWpo2W2Udau8MIXwGZE0uJKgaxvoZodt2MimA41ZyLUm5qipdOSnyPulk3EvfRIjreR\n 4lIDpbBTmwOhRQSTB9LhnlTmQLBxTJ81jM2jzcUIuSq4+sjmsTCouN9Y0ye0emIigrdE\n 4Qnw==; darn=gcc.gnu.org"],"ARC-Authentication-Results":["i=2; server2.sourceware.org","i=1; mx.google.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775891586; x=1776496386; darn=gcc.gnu.org;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=pUeYEz4jTMorEmbfqK3Wr1E0Z/LEnPZ7ZO2w39bI2cY=;\n b=NNmp7fIIfmR+3AEqHsua0VS7SZlgdp7ttEPMCcVmsRfOy7BcTQcBV3Pgm7Qz1nbHg5\n gFH8yJWA92Xq5oDhWDleQ6HtNT+HxdBULNMqzXFVdZuDz2A7Z9vvPCuJFi6YWxmzBIN5\n /WU2LD+YwtjJqU1IrPI2DZyPCRs7R85Qe0k4lVMUBXtQlzi+eGmR8tiwEFMCwOL2xA/F\n 87tf2hIndEePx9/uAYoVP6HRSAYR9C4rjhTW+ASJricByy9Gx4Jnxk+qe8xG+k+C8sQy\n KJ80v+OD5mTgT8WnWz89x6gvy1J6ucelGgR8sWlSQlltdT97s/WeKhv+VwQxVtO3dhoJ\n UMJQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775891586; x=1776496386;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=pUeYEz4jTMorEmbfqK3Wr1E0Z/LEnPZ7ZO2w39bI2cY=;\n b=WmrORbvF3doq7NUUw2qaAHAK0IT1pG1HQKa9Eelq3zT+b7txfxQtPExeZ80pdGkXjI\n g4IGyM9R7Jvxe46nfW3zdahCMBpvtXG2ZSG+igr3ipmqKjYMPtaiwfPwJDrCX/52eXd+\n VZNf6JlROxG4u7n6c+vt1Xc1ioDynAgtqlySGvab8Aj1znMWThblQz7dg/frGms/EmYm\n 2C468KjaQfylt8Jf78yX1F5AHzA0mMPGYUB+9y1XT6gv7k81azW+TwYnkbA9DJlMdi//\n Qo0mtp078KRQ85KV8zxj1C37cLSeB135SsSC+AwZfqD4iaMe4HnMHcplyGKU/aIXodgR\n LiEg==","X-Forwarded-Encrypted":"i=1;\n AJvYcCUg5/8SlxRrl1vHTnKtbUdxLOmbei+suObUDUJyWT9Reei4LMu8qtaTuP4JRqYTPZr6LJh+4LU451CBsQ==@gcc.gnu.org","X-Gm-Message-State":"AOJu0YwvLFssp1PLVIQU93R/ZDpM9z13p7mrtKAb77fuEfpzL1QgocYa\n gxSyWWMAEzk4el/Azz8FRyJs3/tmHNY/m49oSCVLRzD9a1amKGtQaltEY43LRvauW4zDvSlP5qw\n QCEMCOcALL/yCbwGI8FKQ+boxfrBhwBw=","X-Gm-Gg":"AeBDieuxOw1TdKB1455t9LhcEruTpsLEYViYBqksmJOUlZWHxOhuHMMtSNYnAK/Fgg5\n Mz0S4DEv/2OEAB1cofwud52CfiWHndnFC3nG0t3tN3umDs5eW+f5JgSzS1wAFjf+Fs3IaZGiid6\n vqwFmyR0t1SdhsPGxGqCmP08HlIBQ/YjPH+eUyO1KVfv4AgBRIwmSjGqvGUUp3s5xSWqBfxPEsL\n i6HbLCJ7YckQ+j8JqXQy+R1bDAHItf9ImlRzMCk7vflmemVjrJQ8hbc2zzMp8H+eBd2TKWdbsDd\n DAfK7maEcPQIpvEAgzisIMsSby3xvsmIVNkyFiKO4w==","X-Received":"by 2002:a05:7022:ba3:b0:128:cbc7:4c28 with SMTP id\n a92af1059eb24-12c34f1c63dmr3560506c88.35.1775891585897; Sat, 11 Apr 2026\n 00:13:05 -0700 (PDT)","MIME-Version":"1.0","References":"<6369a135-75fd-4108-88f2-7aca575d05af@gmail.com>","In-Reply-To":"<6369a135-75fd-4108-88f2-7aca575d05af@gmail.com>","From":"Paul Richard Thomas <paul.richard.thomas@gmail.com>","Date":"Sat, 11 Apr 2026 08:12:54 +0100","X-Gm-Features":"AQROBzD3FoUchq80a-xBc5FXWORuN4DBCUQT-Dp5tu9kdrLGfrE2DNYXiy6HXDE","Message-ID":"\n <CAGkQGiLdie+7sThthGMUv4OSq5iuRn=-ep7y2rNK3mdSqHS77w@mail.gmail.com>","Subject":"Re: [PATCH,fortran] Fix Bug 93814 - [13/14/15/16 Regression] ICE in\n build_entry_thunks ...","To":"Jerry D <jvdelisle2@gmail.com>","Cc":"gfortran <fortran@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>,\n Christopher Albert <albert@tugraz.at>","Content-Type":"text/plain; charset=\"UTF-8\"","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"}}]