diff options
author | Tobias Burnus <burnus@net-b.de> | 2013-02-15 11:17:15 +0000 |
---|---|---|
committer | Tobias Burnus <burnus@net-b.de> | 2013-02-15 11:17:15 +0000 |
commit | d40b3684e7326834ba83d38bea5fb1daa6315bfa (patch) | |
tree | ecc932de0bafe7b1f00422f0e108c4cbfc651409 /gcc/fortran | |
parent | dc4782621397f5f47e3c3a7a8a1fe8599c15c884 (diff) |
2013-02-14 Tobias Burnus <burnus@net-b.de>
Mikael Morin <mikael@gcc.gnu.org>
PR fortran/56318
* simplify.c (gfc_simplify_matmul): Fix result shape
and matmul result.
2013-02-14 Tobias Burnus <burnus@net-b.de>
PR fortran/56318
* gcc/testsuite/gfortran.dg/matmul_9.f90: New.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@196075 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/simplify.c | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index fff83c41ff3..277ad3ef595 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,4 +1,11 @@ 2013-02-15 Tobias Burnus <burnus@net-b.de> + Mikael Morin <mikael@gcc.gnu.org> + + PR fortran/56318 + * simplify.c (gfc_simplify_matmul): Fix result shape + and matmul result. + +2013-02-15 Tobias Burnus <burnus@net-b.de> PR fortran/53818 * resolve.c (apply_default_init_local): Don't create an diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index f7401e96d01..a0909a38349 100644 --- a/gcc/fortran/simplify.c +++ b/gcc/fortran/simplify.c @@ -3850,7 +3850,7 @@ gfc_simplify_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b) if (matrix_a->rank == 1 && matrix_b->rank == 2) { result_rows = 1; - result_columns = mpz_get_si (matrix_b->shape[0]); + result_columns = mpz_get_si (matrix_b->shape[1]); stride_a = 1; stride_b = mpz_get_si (matrix_b->shape[0]); @@ -3860,7 +3860,7 @@ gfc_simplify_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b) } else if (matrix_a->rank == 2 && matrix_b->rank == 1) { - result_rows = mpz_get_si (matrix_b->shape[0]); + result_rows = mpz_get_si (matrix_a->shape[0]); result_columns = 1; stride_a = mpz_get_si (matrix_a->shape[0]); stride_b = 1; @@ -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; |