This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PR Fortran/83183] Fix infinite recursion (ICE) with -finit-derived when initializing allocatable BT_DERIVED components
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Fritz Reese <fritzoreese at gmail dot com>
- Cc: fortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 25 Jun 2018 18:04:15 -0700
- Subject: Re: [PR Fortran/83183] Fix infinite recursion (ICE) with -finit-derived when initializing allocatable BT_DERIVED components
- References: <CAE4aFAkMMbiN67RVp6XT0OmSTW=2A-eXw+8SOBMeaaw3SeDe-w@mail.gmail.com>
- Reply-to: sgk at troutmask dot apl dot washington dot edu
On Mon, Jun 25, 2018 at 06:06:13PM -0400, Fritz Reese wrote:
>
> The attached patch fixes PR 83183. Previously, attempting to generate
> initializers for allocatable components of the same derived type
> triggered infinite recursion. Passes regression tests. OK for trunk
> and gcc-8-branch?
>
> if (c->initializer || !generate
> || (ts->type == BT_CLASS && !c->attr.allocatable)
> + || (ts->type == BT_DERIVED && c->attr.allocatable)
Fritz,
The patch looks simple enough. It does seem odd to me
that BT_CLASS has !c->attr.allocatable and BT_DERIVED
is c->attr.allocatable, i.e., bang vs no bang. Is this
because class is not affected by -finit-derived?
--
Steve