re PR fortran/83900 (ICE in gfc_simplify_matmul, at fortran/simplify.c:4593)
authorSteven G. Kargl <kargl@gcc.gnu.org>
Sat, 20 Jan 2018 06:15:55 +0000 (06:15 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Sat, 20 Jan 2018 06:15:55 +0000 (06:15 +0000)
2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/83900
* simplify.c (gfc_simplify_matmul): Delete bogus assertion.

2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/83900
* gfortran.dg/matmul_17.f90: New test.

From-SVN: r256912

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

index 3fd3bf8234ce81d32a770983b43d67b8dd6f8018..6eb073138f33b38f506a9b67c96256330508eb9a 100644 (file)
@@ -1,3 +1,8 @@
+2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/83900
+       * simplify.c (gfc_simplify_matmul): Delete bogus assertion.
+
 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
 
        PR fortran/83864
index b7c6b02081f874caef7dbe15313bcd2dd6273305..0c48e7c3bec4e0beee1919148042fa96d1c525ed 100644 (file)
@@ -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);
index de96f4dae7ffad786e6eb5163afa289cb12a479d..0f7baad75a68d1cc60e2996dcd636cd1f6d19826 100644 (file)
@@ -1,3 +1,8 @@
+2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/83900
+       * gfortran.dg/matmul_17.f90: New test.
+
 2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        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 (file)
index 0000000..b21f02b
--- /dev/null
@@ -0,0 +1,9 @@
+! { dg-do run }
+! PR Fortran/83900
+! Contributed by Gerhard Steinmetz  <gscfq t t-online dot de>
+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