get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2224908/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2224908,
    "url": "http://patchwork.ozlabs.org/api/patches/2224908/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/CAGkQGiK1yewkLV1evex0JELky6fYBEcBhO=UQcMFW2RkRKpSHA@mail.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": "<CAGkQGiK1yewkLV1evex0JELky6fYBEcBhO=UQcMFW2RkRKpSHA@mail.gmail.com>",
    "list_archive_url": null,
    "date": "2026-04-19T14:11:09",
    "name": "[fortran] PR117077 - ICE due to allocatable component in hidden type",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "ff0d4b5e62998a601a7018ba7fa39e18269d6389",
    "submitter": {
        "id": 4392,
        "url": "http://patchwork.ozlabs.org/api/people/4392/?format=api",
        "name": "Paul Richard Thomas",
        "email": "paul.richard.thomas@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/CAGkQGiK1yewkLV1evex0JELky6fYBEcBhO=UQcMFW2RkRKpSHA@mail.gmail.com/mbox/",
    "series": [
        {
            "id": 500506,
            "url": "http://patchwork.ozlabs.org/api/series/500506/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=500506",
            "date": "2026-04-19T14:11:09",
            "name": "[fortran] PR117077 - ICE due to allocatable component in hidden type",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/500506/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2224908/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2224908/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=rSxPjjd4;\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 (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=rSxPjjd4",
            "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.44"
        ],
        "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 4fz9Y6541cz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 20 Apr 2026 00:12:08 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 89C9B4BB58D2\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 19 Apr 2026 14:12:05 +0000 (GMT)",
            "from mail-dl1-f44.google.com (mail-dl1-f44.google.com\n [74.125.82.44])\n by sourceware.org (Postfix) with ESMTPS id 846324AADCFA\n for <gcc-patches@gcc.gnu.org>; Sun, 19 Apr 2026 14:11:23 +0000 (GMT)",
            "by mail-dl1-f44.google.com with SMTP id\n a92af1059eb24-1279eced0b9so2914456c88.0\n for <gcc-patches@gcc.gnu.org>; Sun, 19 Apr 2026 07:11:23 -0700 (PDT)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 89C9B4BB58D2",
            "OpenDKIM Filter v2.11.0 sourceware.org 846324AADCFA"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 846324AADCFA",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 846324AADCFA",
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1776607883; cv=pass;\n b=fVwiazyp/o1wpVPrRtSHaFHT8K/NVuFlsS4FCR850Jc9+tM2PGnMOBcMeFNesyUzAgfLB+jjj5NbtKi4eKBFeqhs3rBFJfV30tOS2LVDCVW1QZpfgeC5p3y1Qfj0XX9k2F7uaugPdFizT4liggyxrUzM20PtO4GZY1JDdoQTtvQ=",
            "i=1; a=rsa-sha256; t=1776607882; cv=none;\n d=google.com; s=arc-20240605;\n b=PLa57PeoG86IxyzbkUe1EL5SAoo42aCE7IuMBL1rgIJ8rYaUKigIfux6i2VQMyAtzX\n nYiEOHP9ZtGCgXZLb9SZgS0pgnXtBFdfNMUyIb8ABgs0lDGQxxoHT+M94txBZhynl+78\n KYQTOXftYVGpiBZzgASKw7okM5znx4szy1jqjrrRtuvUOwQJJ7bbDmiT8fborniJymOn\n wWVaYdlOWeAeM7tN2HjzwaFlffy7CPB0zodoJdqLlQXzee4CSI607X07956CGRqZECOT\n VFlNql00m4gZszq4YHXrivblzHDSkUoPEPpm68jJ2CItbLi6yi4CE94ue/YjsApzw0nt\n nXWQ=="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776607883; c=relaxed/simple;\n bh=XiPw97Z/MfMUiW5lQEOeqhG796603J37whq6D0SVEm0=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=hIMjskfK4e0N7dg+88kBWBijDJ9asK0Laq4Iv5QeFl2c2O0+YGyIQ7Cg98TLjGpMGNYQZXWklBf1BEd2BYKAAM7FfAsAwjqROs7O8fdSTuIPI/vhMlJ+cn3qX9cj8M4jXBf1BMPvDGSz3SRyx0jCeUx4g2eA1Cka1wXUtTRUYKw=",
            "i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=to:subject:message-id:date:from:mime-version:dkim-signature;\n bh=Nw26xyBrP8S8wNWl3iE2Z6RoOwh3LnhRRcu4Cdm2OEM=;\n fh=G/5nUZa8kEJWhN0+b+Y9LaNcQg+9568HnDGU75xtJCk=;\n b=SrycVXExOg7ZC+zxTHC8h1dTj9ZXN1jZkwr40g/WsfkpI+kooOfKAc7k/NRBE0c7sn\n 6K37gg7vJFObggQORVlrW1z5k+BrH/dnIkFqtTxwY0lq9Bp60Gck+PwEzAaw+EXOeCsz\n zf+anI2s8ysXVNx8Pjf0KoSaUESfQK5AUKTFKhmvVXp9IEEIt874SlxTqjoB9lKGWeoj\n 7imvGk8ujhwcTqfUmZu3n4JtJZt5OBsUD43UpuzOmmCtJqHMzUobw+gEvZfmp7YdVvTX\n gWDy9DZHD25nCgR82hpctdQnxB9E6ohPK54a319j7+xRQTIkT4tzkwrRCG5PjfaHjrV7\n FCDw==; 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=1776607882; x=1777212682; darn=gcc.gnu.org;\n h=to:subject:message-id:date:from:mime-version:from:to:cc:subject\n :date:message-id:reply-to;\n bh=Nw26xyBrP8S8wNWl3iE2Z6RoOwh3LnhRRcu4Cdm2OEM=;\n b=rSxPjjd4DvQ9A2zBOo0MmfNlz202DGcOmazR+P8rUylumYPZu7emQzD8gRFEvF9uGf\n okVFYhPGVMbqvAy5Flk19EzufZ7ksB8QfySGPfx/ZeFXdYkjTfIEPaTZ85Cpq39pP73M\n 8tmqKg57ycbfHBk4WtcqZVEHgTMWt+mkfZP3n+POYsP/OtbjRaMEdODJ2/7Ab/uOxcs5\n JBQqzoc+U+u+sX9eMgOsitO3I5eimNSoerDTBdPhX+D/PIZXR81x2YoIk1jYsC1MTjIi\n QnORFrv5ZykshOOEGyv4ljx6YgkrdL+PNR1Q86y7d0ZuiTD6k76K8lstepQKfCJRxUVi\n 4pJA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776607882; x=1777212682;\n h=to:subject:message-id:date:from:mime-version:x-gm-gg\n :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n bh=Nw26xyBrP8S8wNWl3iE2Z6RoOwh3LnhRRcu4Cdm2OEM=;\n b=M+tHSuw04EnYPC4m/FmFw9ShR7a6EoqNqKW3939bdoEBoF4tKL4sGF01rJXuhlZXbv\n ExeAZfNo2VqyE09f4TCbqQlG8kIK6QGl/U3wx//sct7ZQruNpwWqTZHIJxl6UETtrMks\n ywdmQvouETp8s1dq8Zklp+dS14g7A1oVi5hwlRE22B1octe9coVutjfIAEFcGafMJMlk\n hu+V2U/CmddBS+r2KtwVBG0T3Rs8BZMXNaeh+0juhXBeUHKbEgAbGKXAZ07FEiUKJ4Sn\n 4rJGMbHLxKdzzR4BcahVM4wuOcCXurxagJf0bb9XfrtAQPbsbOEv8rJ7RMKj0Z93r4g5\n Mirg==",
        "X-Forwarded-Encrypted": "i=1;\n AFNElJ/QL5fa7dnsPd+CoNlqhTeUqapdGdgK4ZJLsOl+lOhGIqOxkSUggYujFA37kEA6n5SfD3oqpXGy9HbSvw==@gcc.gnu.org",
        "X-Gm-Message-State": "AOJu0YzYjd2oF38O6s3kzpmxgp+RL42/rLVJaCC+0BBO5ROtZSvgFQqJ\n Ah8a1rFsJElcgTwSb6EFwIM1C+PhFwHMSyuH9fwgAkn7nfrk3PfFVz3ki8+gHE2PVz0U9jrUQ81\n mVIHR5h3Bx+EElTeHv/xSijoOYobJSac=",
        "X-Gm-Gg": "AeBDiesDBEsUSy0RRgjH/D8mwlJHWMaodoBi0Uip4zbEppyBDboIs2NtgJE/mg+AesF\n jCT0RCXQx90Wuk7R9Ou6U95xzjIMmndBerR15heXziu1yn8NQU/n1lVxrcIM0z96QWH8Yo+wLYm\n f09MYwkQ/TlmHbMwnX/iVgrIQIz+X7ELO+RjXkRGuZAgeFCrS0vH0HmtaHYrmGRHQUNMaCTt3WI\n mXgluWjoHSrD51uu81b+z7jqR0r0WT2N9vw4SrT/wNG8rphZIFdExvZaw8dwNc736625oZo9/Js\n uvMz77zIWp1UFCZ9k0I06NGAIyz8TpxlsuZ2b4LoFYWd8nBIc4f4",
        "X-Received": "by 2002:a05:7022:4199:b0:12c:2cf8:2f30 with SMTP id\n a92af1059eb24-12c73f83616mr4829380c88.15.1776607881985; Sun, 19 Apr 2026\n 07:11:21 -0700 (PDT)",
        "MIME-Version": "1.0",
        "From": "Paul Richard Thomas <paul.richard.thomas@gmail.com>",
        "Date": "Sun, 19 Apr 2026 15:11:09 +0100",
        "X-Gm-Features": "AQROBzBxDuI0Z07DVvdMW8ydjAMBbD1XWa_cVWkt7UVI8v2KhG6WtJQw1oV8pfk",
        "Message-ID": "\n <CAGkQGiK1yewkLV1evex0JELky6fYBEcBhO=UQcMFW2RkRKpSHA@mail.gmail.com>",
        "Subject": "[Patch, fortran] PR117077 - ICE due to allocatable component in\n hidden type",
        "To": "\"fortran@gcc.gnu.org\" <fortran@gcc.gnu.org>,\n gcc-patches <gcc-patches@gcc.gnu.org>",
        "Content-Type": "multipart/mixed; boundary=\"000000000000b68915064fd0c191\"",
        "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": "I initially found it difficult to imagine where one might use the\ntestcase. However, the elaborated version that appears in the attached\npatch indicates some potential uses.\n\nThe fix addresses the cause of the ICE directly:\nin fold-const.cc\n    default:\n      if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (orig))\nreturn fold_build1_loc (loc, NOP_EXPR, type, arg);\n      gcc_unreachable ();\n    }\n\nIf this condition is not met, the rhs is converted to a\nVIEW_CONVERT_EXPR. I have taken the conservative choice of not\nreplacing the fold_convert entirely, just to prevent potential\nregressions before the gcc-16 release.\n\nRegtested of FC43/x86_64 - OK for mainline?\n\nPaul",
    "diff": "From c5027ab3d0f85df18f92f94cee5614ad486c5c9c Mon Sep 17 00:00:00 2001\nFrom: Paul Thomas <pault@gcc.gnu.org>\nDate: Sun, 19 Apr 2026 15:00:14 +0100\nSubject: [PATCH] Fortran:  ICE due to allocatable component in hidden type\n [PR117077]\n\n2026-03-19  Paul Thomas  <pault@gcc.gnu.org>\n\ngcc/fortran\n\tPR fortran/117077\n\t*trans-expr.cc (gfc_trans_scalar_assign): If the lhs and rhs\n\tTYPE_MAIN_VARIANTs are not the same, convert the rhs to the lhs\n\ttype via a VIEW_CONVERT_EXPR.\n\ngcc/testsuite/\n\tPR fortran/117077\n\t* gfortran.dg/pr117077.f90: New test.\n---\n gcc/fortran/trans-expr.cc              | 12 +++++-\n gcc/testsuite/gfortran.dg/pr117077.f90 | 56 ++++++++++++++++++++++++++\n 2 files changed, 66 insertions(+), 2 deletions(-)\n create mode 100644 gcc/testsuite/gfortran.dg/pr117077.f90\n\ndiff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc\nindex 3b9a9337984..2f14e8c3f6c 100644\n--- a/gcc/fortran/trans-expr.cc\n+++ b/gcc/fortran/trans-expr.cc\n@@ -11850,8 +11850,16 @@ gfc_trans_scalar_assign (gfc_se *lse, gfc_se *rse, gfc_typespec ts,\n \n       gfc_add_block_to_block (&block, &lse->pre);\n \n-      gfc_add_modify (&block, lse->expr,\n-\t\t\t   fold_convert (TREE_TYPE (lse->expr), rse->expr));\n+      if (TYPE_MAIN_VARIANT (TREE_TYPE (lse->expr))\n+\t  == TYPE_MAIN_VARIANT (TREE_TYPE (rse->expr)))\n+\tgfc_add_modify (&block, lse->expr,\n+\t\t\tfold_convert (TREE_TYPE (lse->expr), rse->expr));\n+      else\n+\t{\n+\t  tmp = fold_build1_loc (input_location, VIEW_CONVERT_EXPR,\n+\t\t\t\t TREE_TYPE (lse->expr), rse->expr);\n+\t  gfc_add_modify (&block, lse->expr, tmp);\n+\t}\n \n       /* Restore pointer address of coarray components.  */\n       if (ts.u.derived->attr.coarray_comp && deep_copy && tmp_var != NULL_TREE)\ndiff --git a/gcc/testsuite/gfortran.dg/pr117077.f90 b/gcc/testsuite/gfortran.dg/pr117077.f90\nnew file mode 100644\nindex 00000000000..9206569b6d9\n--- /dev/null\n+++ b/gcc/testsuite/gfortran.dg/pr117077.f90\n@@ -0,0 +1,56 @@\n+! { dg-do run }\n+!\n+! Test the fix for PR117077. The test has been made more elaborate that the\n+! original to demonstrate that the hidden derived type can be used as a container\n+! for returning processed/verified versions of a number of variables.\n+!\n+! Contributed by Ivan Pribec  <ivan.pribec@gmail.com>\n+!\n+module hidden\n+  implicit none\n+  private\n+  public :: foo\n+contains\n+  type(foo_type) function foo(a1, a2, a3) result(f)\n+    integer, intent(in) :: a1\n+    real(kind(1.0d0)), intent(in) :: a2\n+    real(kind(1.0e0)), intent(in) :: a3(3)\n+    type :: foo_type\n+      integer :: first\n+      real(kind(1.0d0)) :: second\n+      real, allocatable :: third(:)\n+    end type\n+    f = foo_type(a1 - 1, a2 / 2.0, a3 * 2)\n+  end function\n+end module\n+\n+program main\n+  use hidden\n+  type :: main_type\n+    integer :: first\n+    real(kind(1.0d0)) :: second\n+    real, allocatable :: third(:)\n+  end type\n+\n+  integer :: a1 = 42\n+  real(kind(1.0d0)) :: a2 = 5.0d0\n+  real(kind(1.0e0)) :: a3(3) = [1.0,2.0,3.0]\n+  type(main_type) :: g\n+\n+  associate(f => foo(a1, a2, a3)) ! ICE in the assignment of foo result to f\n+    if (f%first /= a1 - 1) stop 1\n+    if (int (f%second) /= int(a2 / 2.0)) stop 2\n+    if (kind (f%second) /= kind (a2)) stop 3\n+    if (.not.allocated(f%third)) stop 4\n+    if (any (abs (f%third - a3 * 2) > 1e-6)) stop 5\n+  end associate\n+\n+  g = transfer (foo(a1, a2, a3), mold = g)\n+  if (g%first /= a1 - 1) stop 11\n+  if (int (g%second) /= int(a2 / 2.0)) stop 12\n+  if (kind (g%second) /= kind (a2)) stop 13\n+  if (.not.allocated(g%third)) stop 14\n+  if (any (abs (g%third - a3 * 2) > 1e-6)) stop 15\n+\n+  deallocate (g%third)\n+end program\n-- \n2.53.0\n\n",
    "prefixes": [
        "fortran"
    ]
}