get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2196545,
    "url": "http://patchwork.ozlabs.org/api/patches/2196545/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/CAGkQGiLjDrL6Gvwvbk4K5Z1Rq3jz8Xto0u8EcECdG7ifj=Phtw@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": "<CAGkQGiLjDrL6Gvwvbk4K5Z1Rq3jz8Xto0u8EcECdG7ifj=Phtw@mail.gmail.com>",
    "list_archive_url": null,
    "date": "2026-02-14T17:28:31",
    "name": "[fortran] PR108663 - Accepts invalid bug with pdtXXX",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "2ab6e110ba2e00028473cf609257d39616a8a0be",
    "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/CAGkQGiLjDrL6Gvwvbk4K5Z1Rq3jz8Xto0u8EcECdG7ifj=Phtw@mail.gmail.com/mbox/",
    "series": [
        {
            "id": 492187,
            "url": "http://patchwork.ozlabs.org/api/series/492187/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=492187",
            "date": "2026-02-14T17:28:31",
            "name": "[fortran] PR108663 - Accepts invalid bug with pdtXXX",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/492187/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2196545/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2196545/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=20230601 header.b=nNv44wE5;\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=20230601 header.b=nNv44wE5",
            "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.48"
        ],
        "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 4fCwyG26hNz1xpl\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 15 Feb 2026 04:29:20 +1100 (AEDT)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id D126A4BAD148\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 14 Feb 2026 17:29:15 +0000 (GMT)",
            "from mail-dl1-f48.google.com (mail-dl1-f48.google.com\n [74.125.82.48])\n by sourceware.org (Postfix) with ESMTPS id E63394B9DB7C\n for <gcc-patches@gcc.gnu.org>; Sat, 14 Feb 2026 17:28:44 +0000 (GMT)",
            "by mail-dl1-f48.google.com with SMTP id\n a92af1059eb24-124899ee9d3so1371187c88.0\n for <gcc-patches@gcc.gnu.org>; Sat, 14 Feb 2026 09:28:44 -0800 (PST)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org D126A4BAD148",
            "OpenDKIM Filter v2.11.0 sourceware.org E63394B9DB7C"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org E63394B9DB7C",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org E63394B9DB7C",
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1771090125; cv=pass;\n b=jL1gSQ/MO0OExnLpO66U5WnvDUD3Doz9/d1asUBb0kQtcWeANA7RhUxbpK4ODFLLOTxO6NiF5dLmp3iSWqKuiVijUol0IwD2W4NlXnKlN12DBrIdjJuz5aFY3OsPnkY28+HlboJ49DG5FS+GaH03wpbc3OpHLCw0eLXQiqKGxXw=",
            "i=1; a=rsa-sha256; t=1771090124; cv=none;\n d=google.com; s=arc-20240605;\n b=WwdJuEjtl6zu0nRdtpcxfx+yCiPsiqMTsSf2hhr5SbLto0MSEjyqRwpyaPkKJaQMqn\n RmGmMkGJ4estpbKWNREG4OwJkL+V1uxz23z1j+9lzZE8+QrfZ+Vbg1xELA8pwgJgwuOY\n twJx6VGB9LcIf9teIkvVvXuMZayV601TOy0La1ij7LU0//scXC0Erjg/3n8KhmO2RWDv\n ZjZvsvp63ZvpuMYQKdvG98FLlH1mrR4KmpP+Xn2mTQc4LncFhmXzTNgNGtQsxImd07nW\n N+avh0/KvgGP/wzozw1ZVOsQAf2uY6JMlnABjKkaIBEvm9LuaInQB3NCwc2X5/AF0/oT\n yo9g=="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=sourceware.org; s=key;\n t=1771090125; c=relaxed/simple;\n bh=E/4GfzaznOmTLYtHQwLjqh7/UxAJFizrYqbItxr5jhE=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=xZwywQiPMc5FQEC0GTpHrlYUsYSpObpxpA7vczxnMbpkeQqIwKZESoVYqAmTfKisZVTOqBlp0y38lc9Jkoc0xHdcp1wDOzokqMnqBQnuSCuxo3ZcQORYK4eaH/SwO5TcPIi3Tpo9acBHVShSuIolEYqeXifPF7v1Re5nEVYZaMw=",
            "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=E/4GfzaznOmTLYtHQwLjqh7/UxAJFizrYqbItxr5jhE=;\n fh=qk5r9vEE8dXUvc13rYxNVJ96z2WkyTgg6xxXP68917g=;\n b=U31gP2B2aOkeZiB/EFr2xcXNBv+tbAe3MeCM7PyY4Ze78M5u799RQprHSXaM4f1ycq\n F9jKKFOW9hmQDEZsqhhNvEUqcibzKc4mX4yhHPfsaH1HQm8iZ5SyxIrOcoCKmsGgqN+C\n q1N4c9/iG6JNwevzac4nO6E3+hL4zJM6CfmRc961WQqGLvZ/DSjJDMd0xAC7dQlVzJS9\n A8L8ddqoj6GmVXYMbmveLHC2o2QWyUIvMOjeLmMTYX14lnGUjbp1Ou0xc72DO2KEcNnU\n /rNb1j5pNEPn38r+TEYEXfemyzXvKCrm+qAhnf+gXDl4ZKZ+sN+HB4AhN7SZfW0oEQnO\n ooDg==; 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=20230601; t=1771090124; x=1771694924; 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=E/4GfzaznOmTLYtHQwLjqh7/UxAJFizrYqbItxr5jhE=;\n b=nNv44wE5wLfYHya9/kNnqq2pZ13y/fFvwIAqERqBNRLTHP18DSPhI8LFF3jf6KnRrX\n cHWGxCo2Mbn6Q3TP5800qApuX+l+AtscMPeekHAWdnkJNF9EalBAIkHkkGE2HnQOQvfS\n Udy/mV4zjCqNks8+8FsezSFGpTyPZm8d1w/Do7M8vIHcn/ZJq9YZ8APUmhLjq+kOu3Io\n 9PpC3h4ykp21udIS6unNDyQlMlmTLbsZkCieYLLK/mah0MNfpfWogIHqh/iDNIP1Nr6o\n d7FaryU54TE/ACuvr9gCUtkRT16NSbzaWNy5SI2fJBsUOtuz7XILLHVBbQi5XUePFHkp\n 7jQQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1771090124; x=1771694924;\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=E/4GfzaznOmTLYtHQwLjqh7/UxAJFizrYqbItxr5jhE=;\n b=XlfEEoayuU4xI//sfkLfJ3TVMTd0K8svC9GMJrtgSlGfGj+Qx996GsT7S4Stu0px+b\n PeEWtmnFhvQOluTl4txvBP3bWrQqoJLljnUvCLSV+sq+OS59E9bKhNm6iFi3LOlH98QU\n 6VFdmTaRVvJkfsYihD0lPfwhtocloW+dLL0t9Wb7j1RE+HbLONEsR1jHPycD53pJJLzs\n NqRrFNh171Z04jmByd/P1l6Qdvw9wU0ILTErFKyraMvBsZY7rfF45DJ2I6pWcNkcgEBU\n NO/KXtZRBCiMbnx7VFW6YkErAJaetCbE4+EzM+7kcA2pY2SoDtvQzuZmCCJDHTVtwSVG\n 8aWA==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCVa7Fn7P8aKyAh3u0gDaNOR6mQTjZd23OTzoNpGewmkt29K0nimWxwcwA8cPkMstXGxEBKg9M2uezq4HA==@gcc.gnu.org",
        "X-Gm-Message-State": "AOJu0YyCFaH4eUoJAr/qA5gnc2gFN6IhnJEHH0r+Ob9e7N7ABOVegG94\n PMmmDMMDn+v6pW9sKeqzVTXw2JpfpVDip9Zla4krSgCOA7W89QCxJAOUWgbCjLPIvot/T+6HTP3\n B5n4Xsjs3CO/kV+LHMDongQ2vKeOHA4g3POG8",
        "X-Gm-Gg": "AZuq6aIL23C/A6klbeO8PKWHKQYze+V+p2jTNJjLpdqAtP2Nhjf1L87bLXo95bWSFyf\n vzTJMLZxOzJam3+0O0o2j1aci04B2U58sQerh3gdGGS/MNSmnEYagA4q07MQPtM6jR0jF9LVrXf\n 11/wBnyA42fjrVNT88076hEHVEt3ZGfWfD/b2TQT+zaJyVaBuUicD555BpJlm6xc1a7me0pRRRp\n A0DhZZ2H+9uZSHtuNtVJjkqkOJPGVQg0o9qLIzEST5SjAz48C7/dWKKjJeX3W3GXfHxsRJTwu05\n s9oTe6iUm70ptTb0K2Xl5uX/Hhrc5kIZXmvBBBqX6A==",
        "X-Received": "by 2002:a05:7022:6091:b0:123:2de5:346e with SMTP id\n a92af1059eb24-12740f2a0f0mr1662440c88.0.1771090123588; Sat, 14 Feb 2026\n 09:28:43 -0800 (PST)",
        "MIME-Version": "1.0",
        "From": "Paul Richard Thomas <paul.richard.thomas@gmail.com>",
        "Date": "Sat, 14 Feb 2026 17:28:31 +0000",
        "X-Gm-Features": "AZwV_Qi-T-INzh2bypvkuTAFHcrBXJObRQ4oGrXLOcdXfPXLx-M_BftvZC06eAU",
        "Message-ID": "\n <CAGkQGiLjDrL6Gvwvbk4K5Z1Rq3jz8Xto0u8EcECdG7ifj=Phtw@mail.gmail.com>",
        "Subject": "[Patch, fortran] PR108663 - Accepts invalid bug with pdtXXX",
        "To": "\"fortran@gcc.gnu.org\" <fortran@gcc.gnu.org>,\n gcc-patches <gcc-patches@gcc.gnu.org>",
        "Content-Type": "multipart/mixed; boundary=\"000000000000af1e15064acc0ddf\"",
        "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": "Hello All,\n\nThis bug allowed direct references by name to PDT instances. It took\nme a long time to have the necessary light bulb moment: The names of\nPDT instances never have to go through the scanner and so are not\nsubject to the ministrations of gfc_wide_tolower. Therefore, rendering\nall the letters of the PDT prefix in upper case prevents pdt_types\nfrom being directly referenced in code.\n\nI took the opportunity to define PDT_TEMPLATE and PDT_TEMPLATE_LEN in\ngfortran.h.\n\nThe chunk in resolve.cc is a funny one. I had previously encountered\nthe test for assumed LEN parameters in typebound procedure dummies\n(pdt_37.f03) failing due to apparently unrelated changes in the\nfrontend. It seems that it is the order of appearance of pdt_templates\nand pdt_types that mattered. The problem is fixed by testing for both,\nas is necessary for this patch to pass regression testing.\n\nRegtests OK with FC43/x86_64. OK for mainline? I will be offline for a\nfew weeks from Monday evening and so I will push the patch then if it\nhasn't been reviewed. In the words of Hitchhikers Guide to the Galaxy,\nit is \"mostly harmless\".\n\nPaul",
    "diff": "diff --git a/gcc/fortran/decl.cc b/gcc/fortran/decl.cc\nindex 2908007d75c..cb6bd6f8cc0 100644\n--- a/gcc/fortran/decl.cc\n+++ b/gcc/fortran/decl.cc\n@@ -3960,10 +3960,9 @@ gfc_get_pdt_instance (gfc_actual_arglist *param_list, gfc_symbol **sym,\n   /* Pointers to the parameter specification being used.  */\n   gfc_actual_arglist *actual_param;\n   gfc_actual_arglist *tail = NULL;\n-  /* Used to build up the name of the PDT instance. The prefix uses 4\n+  /* Used to build up the name of the PDT instance. The prefix uses 3\n      characters and each KIND parameter 2 more.  Allow 8 of the latter. */\n-  char name[GFC_MAX_SYMBOL_LEN + 21];\n-\n+  char name[GFC_MAX_SYMBOL_LEN + PDT_PREFIX_LEN + 16];\n   bool name_seen = (param_list == NULL);\n   bool assumed_seen = false;\n   bool deferred_seen = false;\n@@ -3980,7 +3979,7 @@ gfc_get_pdt_instance (gfc_actual_arglist *param_list, gfc_symbol **sym,\n \n   type_param_name_list = pdt->formal;\n   actual_param = param_list;\n-  sprintf (name, \"Pdt%s\", pdt->name);\n+  sprintf (name, \"%s%s\", PDT_PREFIX, pdt->name);\n \n   /* Prevent a PDT component of the same type as the template from being\n      converted into an instance. Doing this results in the component being\ndiff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h\nindex 109bf6a5c29..c9242a3adcc 100644\n--- a/gcc/fortran/gfortran.h\n+++ b/gcc/fortran/gfortran.h\n@@ -4310,6 +4310,8 @@ bool gfc_may_be_finalized (gfc_typespec);\n \t(expr && expr->expr_type == EXPR_VARIABLE \\\n \t && expr->symtree->n.sym->assoc \\\n \t && expr->symtree->n.sym->assoc->inferred_type)\n+#define PDT_PREFIX \"PDT\"\n+#define PDT_PREFIX_LEN 3\n #define IS_PDT(sym) \\\n \t(sym != NULL && sym->ts.type == BT_DERIVED \\\n \t && sym->ts.u.derived \\\ndiff --git a/gcc/fortran/module.cc b/gcc/fortran/module.cc\nindex 47b1c943132..04ddf6b4476 100644\n--- a/gcc/fortran/module.cc\n+++ b/gcc/fortran/module.cc\n@@ -5843,13 +5843,14 @@ read_module (void)\n \t  /* Include pdt_types if their associated pdt_template is in a\n \t     USE, ONLY list.  */\n \t  if (p == NULL && name[0] == 'P'\n-\t      && startswith (name, \"Pdt\")\n+\t      && startswith (name, PDT_PREFIX)\n \t      && module_list)\n \t    {\n \t      gfc_use_list *ml = module_list;\n \t      for (; ml; ml = ml->next)\n \t\tif (ml->rename\n-\t\t    && !strncmp (&name[3], ml->rename->use_name,\n+\t\t    && !strncmp (&name[PDT_PREFIX_LEN],\n+\t\t\t\t ml->rename->use_name,\n \t\t\t\t strlen (ml->rename->use_name)))\n \t\t  p = name;\n \t    }\ndiff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc\nindex e5b36234d7e..7d19c946b6d 100644\n--- a/gcc/fortran/resolve.cc\n+++ b/gcc/fortran/resolve.cc\n@@ -16684,9 +16684,10 @@ resolve_typebound_procedure (gfc_symtree* stree)\n \t  goto error;\n \t}\n \n-      if (resolve_bindings_derived->attr.pdt_template\n-\t  && gfc_pdt_is_instance_of (resolve_bindings_derived,\n-\t\t\t\t     CLASS_DATA (me_arg)->ts.u.derived)\n+      if (((resolve_bindings_derived->attr.pdt_template\n+\t    && gfc_pdt_is_instance_of (resolve_bindings_derived,\n+\t\t\t\t       CLASS_DATA (me_arg)->ts.u.derived))\n+\t   || resolve_bindings_derived->attr.pdt_type)\n           && (me_arg->param_list != NULL)\n           && (gfc_spec_list_type (me_arg->param_list,\n \t\t\t\t  CLASS_DATA(me_arg)->ts.u.derived)\ndiff --git a/gcc/fortran/symbol.cc b/gcc/fortran/symbol.cc\nindex d521bf1012b..5a68f44ca63 100644\n--- a/gcc/fortran/symbol.cc\n+++ b/gcc/fortran/symbol.cc\n@@ -5467,14 +5467,14 @@ gfc_type_is_extension_of (gfc_symbol *t1, gfc_symbol *t2)\n    gfc_symbol *t2 -> pdt instance to be verified.\n \n    In decl.cc, gfc_get_pdt_instance, a pdt instance is given a 3 character\n-   prefix \"Pdt\", followed by an underscore list of the kind parameters,\n+   prefix PDT_PREFIX, followed by an underscore list of the kind parameters,\n    up to a maximum of 8 kind parameters.  To verify if a PDT Type corresponds\n    to the template, this functions extracts t2's derive_type name,\n    and compares it to the derive_type name of t1 for compatibility.\n \n    For example:\n \n-   t2->name = Pdtf_2_2; extract out the 'f' and compare with t1->name.  */\n+   t2->name = PDT_PREFIXf_2_2; extract the 'f' and compare with t1->name.  */\n \n bool\n gfc_pdt_is_instance_of (gfc_symbol *t1, gfc_symbol *t2)\n@@ -5483,7 +5483,8 @@ gfc_pdt_is_instance_of (gfc_symbol *t1, gfc_symbol *t2)\n     return false;\n \n   /* Limit comparison to length of t1->name to ignore new kind params.  */\n-  if ( !(strncmp (&(t2->name[3]), t1->name, strlen (t1->name)) == 0) )\n+  if ( !(strncmp (&(t2->name[PDT_PREFIX_LEN]), t1->name,\n+\t\t  strlen (t1->name)) == 0) )\n     return false;\n \n   return true;\ndiff --git a/gcc/testsuite/gfortran.dg/pdt_15.f03 b/gcc/testsuite/gfortran.dg/pdt_15.f03\nindex 17d4d37d3fa..f7ee691cfce 100644\n--- a/gcc/testsuite/gfortran.dg/pdt_15.f03\n+++ b/gcc/testsuite/gfortran.dg/pdt_15.f03\n@@ -101,6 +101,6 @@ contains\n     if (int (pop_8 (root)) .ne. 0) STOP 4\n   end subroutine\n end program ch2701\n-! { dg-final { scan-tree-dump-times \"Pdtlink_8._deallocate \" 5 \"original\" } }\n+! { dg-final { scan-tree-dump-times \"PDTlink_8._deallocate \" 5 \"original\" } }\n ! { dg-final { scan-tree-dump-times \".n.data = 0B\" 9 \"original\" } }\n ! { dg-final { scan-tree-dump-times \"__builtin_free\" 15 \"original\" } }\ndiff --git a/gcc/testsuite/gfortran.dg/pdt_71.f03 b/gcc/testsuite/gfortran.dg/pdt_71.f03\nindex ec9cde06731..06deed6ae15 100644\n--- a/gcc/testsuite/gfortran.dg/pdt_71.f03\n+++ b/gcc/testsuite/gfortran.dg/pdt_71.f03\n@@ -40,5 +40,5 @@ contains\n     print *, kind (z%x%n), z%x%n\n   end subroutine\n end\n-! { dg-final { scan-tree-dump-times \"Pdtt2_4.1.x.n = 8\" 1 \"original\" } }\n-! { dg-final { scan-tree-dump-times \"z = Pdtt2_4.1\" 1 \"original\" } }\n+! { dg-final { scan-tree-dump-times \"PDTt2_4.1.x.n = 8\" 1 \"original\" } }\n+! { dg-final { scan-tree-dump-times \"z = PDTt2_4.1\" 1 \"original\" } }\ndiff --git a/gcc/testsuite/gfortran.dg/pdt_79.f03 b/gcc/testsuite/gfortran.dg/pdt_79.f03\nindex 16b40fe6576..68c1810918b 100644\n--- a/gcc/testsuite/gfortran.dg/pdt_79.f03\n+++ b/gcc/testsuite/gfortran.dg/pdt_79.f03\n@@ -57,5 +57,5 @@ contains\n   end subroutine                ! { dg-warning \".mapped_tensor. is used uninitialized\" }\n \n end\n-! { dg-final { scan-tree-dump-times \"Pdttensor_t_4.2.j = 42\" 1 \"original\" } }\n-! { dg-final { scan-tree-dump-times \"struct Pdttensor_t_4 mt\" 1 \"original\" } }\n+! { dg-final { scan-tree-dump-times \"PDTtensor_t_4.2.j = 42\" 1 \"original\" } }\n+! { dg-final { scan-tree-dump-times \"struct PDTtensor_t_4 mt\" 1 \"original\" } }\ndiff --git a/gcc/testsuite/gfortran.dg/pdt_84.f03 b/gcc/testsuite/gfortran.dg/pdt_84.f03\nnew file mode 100644\nindex 00000000000..a473cb8137d\n--- /dev/null\n+++ b/gcc/testsuite/gfortran.dg/pdt_84.f03\n@@ -0,0 +1,28 @@\n+! { dg-do compile }\n+!\n+! Test the fix for PR108663\n+!\n+! Contributed by\n+!\n+module m\n+   type t(n)\n+      integer, len :: n\n+      integer :: a(n)\n+   end type\n+contains\n+   subroutine s(x, arr)\n+      type(t(2)) :: x\n+      integer :: arr(2)\n+      if (any (x%a /= arr)) stop 1\n+   end\n+end\n+program p\n+   use m, only: t, pdtt, s       ! { dg-error \"not found in module\" }\n+\n+   type(t(2)) :: y = t(2)([1,2])\n+   type (pdtt)  :: z             ! { dg-error \"being used before it is defined\" }\n+\n+   call s(y, [1,2])\n+   y = t(2)([3,4])\n+   call s(y, [3,4])\n+end\n",
    "prefixes": [
        "fortran"
    ]
}