[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-fortran
Subject:    Re: [PR fortran/83184] Fix matching code for clist/old-style initializers when encountering assumed-
From:       Fritz Reese <fritzoreese () gmail ! com>
Date:       2018-07-17 13:45:24
Message-ID: CAE4aFAkPtrJsMngdB40K30C=AnuDUD7to1h-2HY+3NPyJ4kaqw () mail ! gmail ! com
[Download RAW message or body]

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

>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic