This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PR fortran/83184] Fix matching code for clist/old-style initializers when encountering assumed-rank declarations


On Tue, Jul 17, 2018, 04:31 Janus Weil <janus@gcc.gnu.org> wrote:

> Did someone actually approve this patch? Apparently it was committed
> as r262744 and caused the following regression:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86543
>
> Cheers,
> Janus
>
>
>
> 2018-06-27 23:07 GMT+02:00 Fritz Reese <fritzoreese@gmail.com>:
> > The attached patch fixes PR fortran/83184, which is actually two
> > distinct bugs as described in the PR. Passes regtests.
> >
> > The patch is attached. OK for trunk and 7/8-branch?
> >
> > From 238f0a0e80c93209bb4e62ba2f719f74f5da164f Mon Sep 17 00:00:00 2001
> > From: Fritz Reese <fritzoreese@gmail.com>
> > Date: Wed, 27 Jun 2018 16:16:31 -0400
> > Subject: [PATCH 2/3] PR fortran/83184
> >
> > Fix handling of invalid assumed-shape/size arrays in legacy initializer
> > lists.
> >
> > gcc/fortran/
> >
> >         * decl.c (match_old_style_init): Initialize locus of variable
> expr when
> >         creating a data variable.
> >         (match_clist_expr): Verify array is explicit shape/size before
> >         attempting to allocate constant array constructor.
> >
> > gcc/testsuite/
> >
> >         * gfortran.dg/assumed_rank_14.f90: New testcase.
> >         * gfortran.dg/assumed_rank_15.f90: New testcase.
> >         * gfortran.dg/dec_structure_8.f90: Update error messages.
> >         * gfortran.dg/dec_structure_23.f90: Update error messages.
> > ---
> >  gcc/fortran/decl.c                             | 63
> +++++++++++++++-----------
> >  gcc/testsuite/gfortran.dg/assumed_rank_14.f90  | 11 +++++
> >  gcc/testsuite/gfortran.dg/assumed_rank_15.f90  | 11 +++++
> >  gcc/testsuite/gfortran.dg/dec_structure_23.f90 |  6 +--
> >  gcc/testsuite/gfortran.dg/dec_structure_8.f90  |  6 +--
> >  5 files changed, 64 insertions(+), 33 deletions(-)
> >  create mode 100644 gcc/testsuite/gfortran.dg/assumed_rank_14.f90
> >  create mode 100644 gcc/testsuite/gfortran.dg/assumed_rank_15.f90
>

The patch touches only code which I introduced originally. However apparently
my revision of trunk when I tested this patch was before the error message
was changed for dec_structure_23.f90 by Steve in r257971 (I had trouble
bootstrapping the latest at the time). Therefore the committing of this
patch “reverted” the change to the testcase. The error message should match
“array with nonconstant bounds”. I’ll fix the testcase later today when I
am in a place where I can do so.



Fritz

>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]