From fa9371cae02b7ddee8f67e6ce8f1cddc3d8fc0e2 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Wed, 4 Jul 2018 18:08:16 +0000 Subject: [PATCH] re PR fortran/82009 ([F08] ICE with block construct) 2018-07-04 Jerry DeLisle 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 | 6 ++++++ gcc/fortran/trans-decl.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/block_16.f08 | 26 ++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/block_16.f08 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index ac4a2374fe5..b43c08358ce 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2018-07-04 Jerry DeLisle + + PR fortran/82009 + * trans-decl.c (gfc_process_block_locals): Delete assert and set + saved_local_decls = NULL_TREE. + 2018-07-02 Richard Biener PR lto/86321 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 254768c5828..08c1ebd2d4b 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6c5efa4cc52..12e49b6f1c4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-07-04 Jerry DeLisle + + PR fortran/82009 + * gfortran.dg/block_16.f08. New test. + 2018-07-04 Aldy Hernandez * 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 index 00000000000..165c719cbbe --- /dev/null +++ b/gcc/testsuite/gfortran.dg/block_16.f08 @@ -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 -- 2.30.2