From f18fee823bb765b1efab04025d28fcf9315fb80b Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Sat, 20 Jan 2018 06:15:55 +0000 Subject: [PATCH] re PR fortran/83900 (ICE in gfc_simplify_matmul, at fortran/simplify.c:4593) 2018-01-19 Steven G. Kargl PR fortran/83900 * simplify.c (gfc_simplify_matmul): Delete bogus assertion. 2018-01-19 Steven G. Kargl PR fortran/83900 * gfortran.dg/matmul_17.f90: New test. From-SVN: r256912 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/simplify.c | 1 - gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/matmul_17.f90 | 9 +++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/matmul_17.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3fd3bf8234c..6eb073138f3 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2018-01-19 Steven G. Kargl + + PR fortran/83900 + * simplify.c (gfc_simplify_matmul): Delete bogus assertion. + 2018-01-17 Harald Anlauf PR fortran/83864 diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index b7c6b02081f..0c48e7c3bec 100644 --- a/gcc/fortran/simplify.c +++ b/gcc/fortran/simplify.c @@ -4590,7 +4590,6 @@ gfc_simplify_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b) || !is_constant_array_expr (matrix_b)) return NULL; - gcc_assert (gfc_compare_types (&matrix_a->ts, &matrix_b->ts)); result = gfc_get_array_expr (matrix_a->ts.type, matrix_a->ts.kind, &matrix_a->where); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index de96f4dae7f..0f7baad75a6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-01-19 Steven G. Kargl + + PR fortran/83900 + * gfortran.dg/matmul_17.f90: New test. + 2018-01-19 Steven G. Kargl PR fortran/80768 diff --git a/gcc/testsuite/gfortran.dg/matmul_17.f90 b/gcc/testsuite/gfortran.dg/matmul_17.f90 new file mode 100644 index 00000000000..b21f02be392 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/matmul_17.f90 @@ -0,0 +1,9 @@ +! { dg-do run } +! PR Fortran/83900 +! Contributed by Gerhard Steinmetz +program p + integer, parameter :: a(3,2) = 1 + real, parameter :: b(2,3) = 2 + real, parameter :: c(3,3) = matmul(a, b) + if (any(c /= 4.)) call abort +end -- 2.30.2