From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1534) id 01AE239D1C20; Fri, 6 Nov 2020 07:27:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01AE239D1C20 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tobias Burnus To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-4766] Fortran: Fix type-decl for PDT / wrong-code pdt_14.f03 issue [PR97652] X-Act-Checkin: gcc X-Git-Author: Tobias Burnus X-Git-Refname: refs/heads/master X-Git-Oldrev: 32ee472864ada44ef05b2a3b087b8ce413bee282 X-Git-Newrev: c283a711c850efaab4fe3bca5ef7200eb854bba1 Message-Id: <20201106072707.01AE239D1C20@sourceware.org> Date: Fri, 6 Nov 2020 07:27:06 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Nov 2020 07:27:07 -0000 https://gcc.gnu.org/g:c283a711c850efaab4fe3bca5ef7200eb854bba1 commit r11-4766-gc283a711c850efaab4fe3bca5ef7200eb854bba1 Author: Tobias Burnus Date: Fri Nov 6 08:26:51 2020 +0100 Fortran: Fix type-decl for PDT / wrong-code pdt_14.f03 issue [PR97652] Parameterized derived types are handled in a special way and start with 'Pdt'. If the 'P' is not uppercase, gfc_get_derived_type (which calls gfc_get_module_backend_decl) does not find the existing declaration and builds a new type. The middle end then sees those types as being different and nonalising, creating an endless loop for pdt_14.f03. gcc/fortran/ChangeLog: PR fortran/97652 * module.c (mio_symbol): Fix symbol name for pdt_type. Diff: --- gcc/fortran/module.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 33e7df7d6a4..4c6ff22d5c1 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -4549,6 +4549,9 @@ mio_symbol (gfc_symbol *sym) mio_symbol_attribute (&sym->attr); + if (sym->attr.pdt_type) + sym->name = gfc_dt_upper_string (sym->name); + /* Note that components are always saved, even if they are supposed to be private. Component access is checked during searching. */ mio_component_list (&sym->components, sym->attr.vtype);