public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Committed] PR fortran/83900 -- Remove bogus assert
@ 2018-01-20  7:05 Steve Kargl
  0 siblings, 0 replies; only message in thread
From: Steve Kargl @ 2018-01-20  7:05 UTC (permalink / raw)
  To: fortran, gcc-patches

The patch and testcase are sufficient to describe the problem.

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.

Index: gcc/fortran/simplify.c
===================================================================
--- gcc/fortran/simplify.c	(revision 256905)
+++ gcc/fortran/simplify.c	(working copy)
@@ -4590,7 +4590,6 @@ gfc_simplify_matmul (gfc_expr *matrix_a, gfc_expr *mat
       || !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: gcc/testsuite/gfortran.dg/matmul_17.f90
===================================================================
--- gcc/testsuite/gfortran.dg/matmul_17.f90	(nonexistent)
+++ gcc/testsuite/gfortran.dg/matmul_17.f90	(working copy)
@@ -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

-- 
Steve

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-20  6:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-20  7:05 [Committed] PR fortran/83900 -- Remove bogus assert Steve Kargl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).