This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/56318] [4.6/4.7/4.8 Regression] Wrong result with MATMUL of PARAMETER
- From: "mikael at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 14 Feb 2013 12:55:29 +0000
- Subject: [Bug fortran/56318] [4.6/4.7/4.8 Regression] Wrong result with MATMUL of PARAMETER
- Auto-submitted: auto-generated
- References: <bug-56318-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56318
Mikael Morin <mikael at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mikael at gcc dot gnu.org
--- Comment #3 from Mikael Morin <mikael at gcc dot gnu.org> 2013-02-14 12:55:29 UTC ---
(In reply to comment #2)
> b) BUG 2: matmul gives the wrong result:
Here is a fix for that. It gives the expected results of comment #0 and
comment #2. Untested otherwise.
diff --git a/simplify.c b/simplify.c
index f7401e9..dcf3e89 100644
--- a/simplify.c
+++ b/simplify.c
@@ -3873,7 +3873,7 @@ gfc_simplify_matmul (gfc_expr *matrix_a, gfc_expr
*matrix_b)
{
result_rows = mpz_get_si (matrix_a->shape[0]);
result_columns = mpz_get_si (matrix_b->shape[1]);
- stride_a = mpz_get_si (matrix_a->shape[1]);
+ stride_a = mpz_get_si (matrix_a->shape[0]);
stride_b = mpz_get_si (matrix_b->shape[0]);
result->rank = 2;