This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/56318] [4.6/4.7/4.8 Regression] Wrong result with MATMUL of PARAMETER


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]