From: Harald Anlauf Date: Thu, 12 Dec 2019 20:39:48 +0000 (+0000) Subject: re PR fortran/92898 (ICE in gfc_check_is_contiguous, at fortran/check.c:7157) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5e4bb241476d2cd81fc1dac1bede902d3dd9c1e3;p=gcc.git re PR fortran/92898 (ICE in gfc_check_is_contiguous, at fortran/check.c:7157) 2019-12-12 Harald Anlauf PR fortran/92898 * check.c (gfc_check_is_contiguous): Simplify check to handle arbitrary NULL() argument. PR fortran/92898 * gfortran.dg/pr92898.f90: New test. From-SVN: r279314 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5fae7f295e1..f8103bb9d8c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2019-12-12 Harald Anlauf + + PR fortran/92898 + * check.c (gfc_check_is_contiguous): Simplify check to handle + arbitrary NULL() argument. + 2019-12-11 Jakub Jelinek PR fortran/92899 @@ -9,7 +15,7 @@ PR fortran/92897 * array.c (gfc_set_array_spec): Remove invalid assert() triggered by invalid Fortran code. - + 2019-12-10 Thomas Koenig PR fortran/91643 diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index d2a4949e12b..deb5160e778 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -7153,8 +7153,7 @@ gfc_check_ttynam_sub (gfc_expr *unit, gfc_expr *name) bool gfc_check_is_contiguous (gfc_expr *array) { - if (array->expr_type == EXPR_NULL - && array->symtree->n.sym->attr.pointer == 1) + if (array->expr_type == EXPR_NULL) { gfc_error ("Actual argument at %L of %qs intrinsic shall be an " "associated pointer", &array->where, gfc_current_intrinsic); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7ddcae3c87f..322074d1b4c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-12-12 Harald Anlauf + + PR fortran/92898 + * gfortran.dg/pr92898.f90: New test. + 2019-12-12 Sudakshina Das PR testsuite/92870 diff --git a/gcc/testsuite/gfortran.dg/pr92898.f90 b/gcc/testsuite/gfortran.dg/pr92898.f90 new file mode 100644 index 00000000000..1c831eda1bb --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr92898.f90 @@ -0,0 +1,6 @@ +! { dg-do compile } +! PR fortran/92898 +! Code contributed by Gerhard Steinmetz +program p + print *, is_contiguous (null()) ! { dg-error "shall be an associated" } +end