re PR fortran/92898 (ICE in gfc_check_is_contiguous, at fortran/check.c:7157)
authorHarald Anlauf <anlauf@gmx.de>
Thu, 12 Dec 2019 20:39:48 +0000 (20:39 +0000)
committerHarald Anlauf <anlauf@gcc.gnu.org>
Thu, 12 Dec 2019 20:39:48 +0000 (20:39 +0000)
2019-12-12  Harald Anlauf  <anlauf@gmx.de>

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

gcc/fortran/ChangeLog
gcc/fortran/check.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr92898.f90 [new file with mode: 0644]

index 5fae7f295e139dc707fd4daf6fa950d448c25f7f..f8103bb9d8cbff96bea8f982faeca8813f9de6e5 100644 (file)
@@ -1,3 +1,9 @@
+2019-12-12  Harald Anlauf  <anlauf@gmx.de>
+
+       PR fortran/92898
+       * check.c (gfc_check_is_contiguous): Simplify check to handle
+       arbitrary NULL() argument.
+
 2019-12-11  Jakub Jelinek  <jakub@redhat.com>
 
        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  <tkoenig@gcc.gnu.org>
 
        PR fortran/91643
index d2a4949e12b41e2809e42a34a9cdb27548cb5a8e..deb5160e778674833271530e714fd0469910b351 100644 (file)
@@ -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);
index 7ddcae3c87f010a065850a1750ccb4922c30d976..322074d1b4c9138b659744c2f090c9919424ed10 100644 (file)
@@ -1,3 +1,8 @@
+2019-12-12  Harald Anlauf  <anlauf@gmx.de>
+
+       PR fortran/92898
+       * gfortran.dg/pr92898.f90: New test.
+
 2019-12-12  Sudakshina Das  <sudi.das@arm.com>
 
        PR testsuite/92870
diff --git a/gcc/testsuite/gfortran.dg/pr92898.f90 b/gcc/testsuite/gfortran.dg/pr92898.f90
new file mode 100644 (file)
index 0000000..1c831ed
--- /dev/null
@@ -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