On Wed, Dec 11, 2019 at 11:24:35PM +0100, Harald Anlauf wrote:
> 
> > Gesendet: Dienstag, 10. Dezember 2019 um 23:34 Uhr
> > Von: "Thomas Koenig" <tkoe...@netcologne.de>
> > An: "Harald Anlauf" <anl...@gmx.de>, gfortran <fort...@gcc.gnu.org>, 
> > gcc-patches <gcc-patches@gcc.gnu.org>
> > Betreff: Re: [Patch, Fortran] PR92898 - [9/10 Regression] ICE in 
> > gfc_check_is_contiguous, at fortran/check.c:7157
> >
> >
> > > Index: gcc/fortran/check.c
> > > ===================================================================
> > > --- gcc/fortran/check.c   (Revision 279183)
> > > +++ gcc/fortran/check.c   (Arbeitskopie)
> > > @@ -7154,7 +7154,9 @@ bool
> > >   gfc_check_is_contiguous (gfc_expr *array)
> > >   {
> > >     if (array->expr_type == EXPR_NULL
> > > -      && array->symtree->n.sym->attr.pointer == 1)
> > > +      && (!array->symtree ||
> > > +   (array->symtree->n.sym &&
> > > +    array->symtree->n.sym->attr.pointer == 1)))
> >
> > I have to admit I do not understand the original code here, nor
> > do I quite understand your fix.
> >
> > Is there any circumstance where array->expr_type == EXPR_NULL, but
> > is_contiguous is valid?  What would go wrong if the other tests
> > were removed?
> 
> Actually I do not know what the additional check was supposed to do.
> Removing it does not seem to do any harm.  See below.
> 

The orginal testcase has NULL(Z) where Z has the pointer
attribute.  See 16.9.144.  NULL(Z) then has the pointer
attribute.  I did not consider NULL(), which is of course
a valid reference.

-- 
Steve

Reply via email to