This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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/83183] Fix infinite recursion (ICE) with -finit-derived when initializing allocatable BT_DERIVED components


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


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