Committed as obvious after regression testing on x86_64-*-freebsd. 2018-01-09 Steven G. Kargl <ka...@gcc.gnu.org>
PR fortran/83742 * expr.c (gfc_is_simply_contiguous): Check for NULL pointer. 2018-01-09 Steven G. Kargl <ka...@gcc.gnu.org> PR fortran/83742 * gfortran.dg/contiguous_6.f90: New test. Index: gcc/fortran/expr.c =================================================================== --- gcc/fortran/expr.c (revision 256390) +++ gcc/fortran/expr.c (working copy) @@ -5313,14 +5313,14 @@ gfc_is_simply_contiguous (gfc_expr *expr, bool strict, sym = expr->symtree->n.sym; if (expr->ts.type != BT_CLASS - && ((part_ref - && !part_ref->u.c.component->attr.contiguous - && part_ref->u.c.component->attr.pointer) - || (!part_ref - && !sym->attr.contiguous - && (sym->attr.pointer - || sym->as->type == AS_ASSUMED_RANK - || sym->as->type == AS_ASSUMED_SHAPE)))) + && ((part_ref + && !part_ref->u.c.component->attr.contiguous + && part_ref->u.c.component->attr.pointer) + || (!part_ref + && !sym->attr.contiguous + && (sym->attr.pointer + || (sym->as && sym->as->type == AS_ASSUMED_RANK) + || (sym->as && sym->as->type == AS_ASSUMED_SHAPE))))) return false; if (!ar || ar->type == AR_FULL) Index: gcc/testsuite/gfortran.dg/contiguous_6.f90 =================================================================== --- gcc/testsuite/gfortran.dg/contiguous_6.f90 (nonexistent) +++ gcc/testsuite/gfortran.dg/contiguous_6.f90 (working copy) @@ -0,0 +1,7 @@ +! { dg-do compile } +! PR fortran/83742 +! Contributed by Gerhard Steinmetz <gscfq at t-online dot de> +program p + real, target :: a + real, pointer, contiguous :: b => a ! { dg-error "has the CONTIGUOUS attribute" } +end -- Steve