re PR fortran/82009 ([F08] ICE with block construct)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Wed, 4 Jul 2018 18:08:16 +0000 (18:08 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Wed, 4 Jul 2018 18:08:16 +0000 (18:08 +0000)
2018-07-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/82009
* trans-decl.c (gfc_process_block_locals): Delete assert and set
saved_local_decls = NULL_TREE.

* gfortran.dg/block_16.f08. New test.

From-SVN: r262416

gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/block_16.f08 [new file with mode: 0644]

index ac4a2374fe56a9dc382ff1c477dd4b1a640d6993..b43c08358ce49cb49343f500f79419e8f34ab29a 100644 (file)
@@ -1,3 +1,9 @@
+2018-07-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/82009
+       * trans-decl.c (gfc_process_block_locals): Delete assert and set
+       saved_local_decls = NULL_TREE.
+
 2018-07-02  Richard Biener  <rguenther@suse.de>
 
        PR lto/86321
index 254768c5828838f526a4d3926037d1d4e34a435d..08c1ebd2d4b9734e3ec34c3a805f64c5dc90ae93 100644 (file)
@@ -6751,7 +6751,7 @@ gfc_process_block_locals (gfc_namespace* ns)
 {
   tree decl;
 
-  gcc_assert (saved_local_decls == NULL_TREE);
+  saved_local_decls = NULL_TREE;
   has_coarray_vars = false;
 
   generate_local_vars (ns);
index 6c5efa4cc52006622be02c070cbd0db658cc579a..12e49b6f1c467cce33fd40be851f6f4cdeda3564 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/82009
+       * gfortran.dg/block_16.f08. New test.
+
 2018-07-04  Aldy Hernandez  <aldyh@redhat.com>
 
        * gcc.dg/tree-ssa/ssa-dom-thread-7.c: Adjust test because aarch64
diff --git a/gcc/testsuite/gfortran.dg/block_16.f08 b/gcc/testsuite/gfortran.dg/block_16.f08
new file mode 100644 (file)
index 0000000..165c719
--- /dev/null
@@ -0,0 +1,26 @@
+! { dg-do compile )
+! PR82009  [F08] ICE with block construct
+MODULE sparse_matrix_csx_benchmark_utils
+  IMPLICIT NONE
+CONTAINS  
+  SUBROUTINE sparse_matrix_csr_benchmark ( )
+    WRITE(*,*) 'At*x: t'
+    block
+      integer, dimension(1), parameter :: idxs=[1]
+      integer :: i, idx
+      do i = 1, size(idxs)
+         idx = idxs(i)
+      enddo
+    end block
+  END SUBROUTINE sparse_matrix_csr_benchmark
+  SUBROUTINE sparse_matrix_csc_benchmark ( )
+    WRITE(*,*) 'An*x: t'
+    block
+      integer, dimension(1), parameter :: idxs=[1]
+      integer :: i, idx
+      do i = 1, size(idxs)
+         idx = idxs(i)
+      enddo
+    end block
+  END SUBROUTINE sparse_matrix_csc_benchmark
+END MODULE sparse_matrix_csx_benchmark_utils