]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR fortran/92898 (ICE in gfc_check_is_contiguous, at fortran/check.c...
authorHarald Anlauf <anlauf@gmx.de>
Thu, 12 Dec 2019 20:46:03 +0000 (20:46 +0000)
committerHarald Anlauf <anlauf@gcc.gnu.org>
Thu, 12 Dec 2019 20:46:03 +0000 (20:46 +0000)
2019-12-12  Harald Anlauf  <anlauf@gmx.de>

Backport from mainline
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: r279315

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

index 22e34ff59d7b136f580bfe1e31d8592b7d3dcdd1..6f9baa48a8f812bdf14d1e0266df5294f0ed2407 100644 (file)
@@ -1,3 +1,10 @@
+2019-12-12  Harald Anlauf  <anlauf@gmx.de>
+
+       Backport from mainline
+       PR fortran/92898
+       * check.c (gfc_check_is_contiguous): Simplify check to handle
+       arbitrary NULL() argument.
+
 2019-12-11 Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/92897
index 4ef354f0a6ef3694b8a20c284ca6c08b415011c0..6d37bbb8fd2a8d2be188f9bdd3aeaa174fb9985d 100644 (file)
@@ -6578,8 +6578,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 4b1d6361476f56c8f60d7ed0d61851adef5351f0..3ec5f55852b1fce42bc2a8da2a0f902d4b458399 100644 (file)
@@ -1,3 +1,9 @@
+2019-12-12  Harald Anlauf  <anlauf@gmx.de>
+
+       Backport from mainline
+       PR fortran/92898
+       * gfortran.dg/pr92898.f90: New test.
+
 2019-12-11 Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/92897
@@ -10,7 +16,7 @@
 2019-12-02  Sandra Loosemore  <sandra@codesourcery.com>
 
        Fix bugs relating to flexibly-sized objects in nios2 backend.
-       
+
        PR target/92499
        * gcc.target/nios2/pr92499-1.c: New.
        * gcc.target/nios2/pr92499-2.c: New.
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