From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34321 invoked by alias); 1 Dec 2017 17:15:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 34289 invoked by uid 89); 1 Dec 2017 17:15:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KB_WAM_FROM_NAME_SINGLEWORD,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=H*i:sk:CJXK9Ab, H*f:sk:CAGkQGi, H*i:sk:CAGkQGi, H*f:sk:CJXK9Ab X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-yb0-f172.google.com Received: from mail-yb0-f172.google.com (HELO mail-yb0-f172.google.com) (209.85.213.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Dec 2017 17:14:53 +0000 Received: by mail-yb0-f172.google.com with SMTP id p128so4270203yba.7; Fri, 01 Dec 2017 09:14:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=WJ8S/TXvIDY8mR3Y+4/lsbgQKHg/rL53CeVZSkJ9r2g=; b=bsiBSe9M5Cro7rK/VOQ5YQ7hD/Pl2Dj9XupCXH7z8NzDLLCzli6eZ512mGZJbElBp2 V/tCXJU5a7E9whX2vGhVdY1/MexLlXMGze20RHUdK2cx0LoTDbGBBmuH/BTVKN1PJU2T eD4PDufJ3tCkhH8nykC/ER2POaWmxlqGkCqRFCvxdJvdZ4DWTh+odWYSSTgxKUOPN6K8 NcowmAR2cBRFnGDB9WwZLzR6sl21onDbbMPAlYe1rxqCGdac6Z4b5LgOhBN4xkr9xlB2 H5xiDnsYRwjS0AD11X+dFgxAFuoht74Fo2NdJ7uFaTjXvhgag+8XkV1QGwIpZQWJm5r3 NEHA== X-Gm-Message-State: AJaThX7cg5GHgZqwcS5omw62WFYYGAiEXAA5ra2gN78Alrn7IJtXWCHD G+Hbw9JPbnfoT9jM1Y4b4NQEvpdTpLUDeh6TqSQYgA== X-Google-Smtp-Source: AGs4zMYPsRtcOD6l8zDrAtKJLj8gVRXR0N0yfz85IOXv9f+iJMuugbUzmzrD15HNuyyCofS8vqTbj/XebvvNzH0qZqU= X-Received: by 10.37.183.197 with SMTP id u5mr4117184ybj.48.1512148491860; Fri, 01 Dec 2017 09:14:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.156.81 with HTTP; Fri, 1 Dec 2017 09:14:51 -0800 (PST) In-Reply-To: References: From: Paul Richard Thomas Date: Fri, 01 Dec 2017 17:15:00 -0000 Message-ID: Subject: Re: [Patch, fortran] PRs 82605, 82606 and 82622 - PDT problems To: "fortran@gcc.gnu.org" , gcc-patches Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2017-12/txt/msg00056.txt.bz2 It turned out that I couldn't stop and so fixed a number of other bugs. All are minor tweaks, well hidden behind the pdt attributes. Committed as r255311. Paul 2017-12-01 Paul Thomas PR fortran/82605 * resolve.c (get_pdt_constructor): Initialize 'cons' to NULL. (resolve_pdt): Correct typo in prior comment. Emit an error if any parameters are deferred and the object is neither pointer nor allocatable. PR fortran/82606 * decl.c (gfc_get_pdt_instance): Continue if the parameter sym is not present or has no name. Select the parameter by name of component, rather than component order. Remove all the other manipulations of 'tail' when building the pdt instance. (gfc_match_formal_arglist): Emit and error if a star is picked up in a PDT decl parameter list. PR fortran/82622 * trans-array.c (set_loop_bounds): If a GFC_SS_COMPONENT has an info->end, use it rather than falling through to gcc_unreachable. (structure_alloc_comps): Check that param->name is non-null before comparing with the component name. * trans-decl.c (gfc_get_symbol_decl): Do not use the static initializer for PDT symbols. (gfc_init_default_dt): Do nothing for PDT symbols. * trans-io.c (transfer_array_component): Parameterized array components use the descriptor ubound since the shape is not available. PR fortran/82719 PR fortran/82720 * trans-expr.c (gfc_conv_component_ref): Do not use the charlen backend_decl of pdt strings. Use the hidden component instead. * trans-io.c (transfer_expr): Do not do IO on "hidden" string lengths. Use the hidden string length for pdt string transfers by adding it to the se structure. When finished nullify the se string length. PR fortran/82866 * decl.c (gfc_match_formal_arglist): If a name is not found or star is found, while reading a type parameter list, emit an immediate error. (gfc_match_derived_decl): On reading a PDT parameter list, on failure to match call gfc_error_recovery. PR fortran/82978 * decl.c (build_struct): Character kind defaults to 1, so use kind_expr whatever is the set value. (gfc_get_pdt_instance): Ditto. * trans-array.c (structure_alloc_comps): Copy the expression for the PDT string length before parameter substitution. Use this expression for evaluation and free it after use. 2017-12-01 Paul Thomas PR fortran/82605 * gfortran.dg/pdt_4.f03 : Incorporate the new error. PR fortran/82606 * gfortran.dg/pdt_19.f03 : New test. * gfortran.dg/pdt_21.f03 : New test. PR fortran/82622 * gfortran.dg/pdt_20.f03 : New test. * gfortran.dg/pdt_22.f03 : New test. PR fortran/82719 PR fortran/82720 * gfortran.dg/pdt_23.f03 : New test. PR fortran/82866 * gfortran.dg/pdt_24.f03 : New test. PR fortran/82978 * gfortran.dg/pdt_10.f03 : Correct for error in coding the for kind 4 component and change the kind check appropriately. * gfortran.dg/pdt_25.f03 : New test. On 30 November 2017 at 12:47, Paul Richard Thomas wrote: > This patch fixes the above PRs and the additional problems in comment > #1 of both 82606 and 82622. > > For the main part, the patch consists of 'obvious' tweaks to the PDT > machinery. The exception to this is the chunk in > trans-array.c(set_loop_bounds), which is needed to handle > parameterized array components coming from trans-io.c. This is safe > because the code would have fallen through to gcc_unreachable > otherwise. If the info->end is present then this can be used. > > Bootstrapped and regtested on FC23/x86_64 - OK for trunk? > > I will commit tomorrow morning if there are no complaints in the meantime. > > Regards > > Paul > > 2017-11-30 Paul Thomas > > PR fortran/82605 > * resolve.c (get_pdt_constructor): Initialize 'cons' to NULL. > (resolve_pdt): Correct typo in prior comment. Emit an error if > any parameters are deferred and the object is neither pointer > nor allocatable. > > PR fortran/82606 > * decl.c (gfc_get_pdt_instance): Continue if the parameter sym > is not present or has no name. Select the parameter by name > of component, rather than component order. Remove all the other > manipulations of 'tail' when building the pdt instance. > (gfc_match_formal_arglist): Emit and error if a star is picked > up in a PDT decl parameter list. > > PR fortran/82622 > * trans-array.c (set_loop_bounds): If a GFC_SS_COMPONENT has an > info->end, use it rather than falling through to > gcc_unreachable. > (structure_alloc_comps): Check that param->name is non-null > before comparing with the component name. > * trans-decl.c (gfc_get_symbol_decl): Do not use the static > initializer for PDT symbols. > (gfc_init_default_dt): Do nothing for PDT symbols. > * trans-io.c (transfer_array_component): Parameterized array > components use the descriptor ubound since the shape is not > available. > > 2017-11-30 Paul Thomas > > PR fortran/82605 > * gfortran.dg/pdt_4.f03 : Incorporate the new error. > > PR fortran/82606 > * gfortran.dg/pdt_19.f03 : New test. > * gfortran.dg/pdt_21.f03 : New test. > > PR fortran/82622 > * gfortran.dg/pdt_20.f03 : New test. > * gfortran.dg/pdt_22.f03 : New test. -- "If you can't explain it simply, you don't understand it well enough" - Albert Einstein