From c3fa5d78ba83b91ca82195aa32d918f2c6fd3a37 Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Mon, 19 Oct 2015 21:09:21 +0000 Subject: [PATCH] re PR fortran/68019 (ICE on rank mismatch of implied-shape array of user-defined type) 2015-10-19 Steven G. Kargl PR fortran/68019 * decl.c (add_init_expr_to_sym): Remove an assert() to allow an error message to be issued. 2015-10-19 Steven G. Kargl PR fortran/68019 * gfortran.dg/pr68019.f90: new test. From-SVN: r229003 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/decl.c | 1 - gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/pr68019.f90 | 13 +++++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/pr68019.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 53d309447b7..0b94ad70658 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2015-10-19 Steven G. Kargl + + PR fortran/68019 + * decl.c (add_init_expr_to_sym): Remove an assert() to allow an error + message to be issued. + 2015-10-18 Mikael Morin PR fortran/67758 diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 4871b7c364e..c7526772e80 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -1486,7 +1486,6 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus) " with scalar", &sym->declared_at); return false; } - gcc_assert (sym->as->rank == init->rank); /* Shape should be present, we get an initialization expression. */ gcc_assert (init->shape); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c4e96a7bc79..9130c7dadda 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-10-19 Steven G. Kargl + + PR fortran/68019 + * gfortran.dg/pr68019.f90: new test. + 2015-10-19 Richard Biener PR tree-optimization/67975 diff --git a/gcc/testsuite/gfortran.dg/pr68019.f90 b/gcc/testsuite/gfortran.dg/pr68019.f90 new file mode 100644 index 00000000000..2e304c3a260 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr68019.f90 @@ -0,0 +1,13 @@ +! { dg-do compile } +! Original code from Gerhard Steinmetz +! Gerhard dot Steinmetz for fortran at t-online dot de +! PR fortran/68019 +! +program p + integer :: i + type t + integer :: n + end type + type(t), parameter :: vec(*) = [(t(i), i = 1, 4)] + type(t), parameter :: arr(*) = reshape(vec, [2, 2]) ! { dg-error "ranks 1 and 2 in assignment" } +end -- 2.30.2