diff mbox

[fortran,committed] Fix size of matmul calculation for a special case

Message ID f526c14f-1007-11c2-ff99-069454dc5e6d@netcologne.de
State New
Headers show

Commit Message

Thomas Koenig May 28, 2017, 2:05 p.m. UTC
Hello world,

I have just committed as obvious a patch fixing a wrong
calculation for allocating the size of a return variable
in inline matmul (PR 80904).  I will backport to the
other affected branches in the near future.

Regards

	Thomas

2017-05-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

         * frontend-passes.c (matmul_lhs_realloc):  Correct
         allocation size for case A1B2.

2017-05-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

         * gfortran.dg/matmul_bounds_12.f90:  New test.
diff mbox

Patch

Index: frontend-passes.c
===================================================================
--- frontend-passes.c	(Revision 248467)
+++ frontend-passes.c	(Arbeitskopie)
@@ -2447,7 +2447,7 @@  matmul_lhs_realloc (gfc_expr *c, gfc_expr *a, gfc_
       break;
 
     case A1B2:
-      ar->start[0] = get_array_inq_function (GFC_ISYM_SIZE, b, 1);
+      ar->start[0] = get_array_inq_function (GFC_ISYM_SIZE, b, 2);
       cond = build_logical_expr (INTRINSIC_NE,
 				 get_array_inq_function (GFC_ISYM_SIZE, c, 1),
 				 get_array_inq_function (GFC_ISYM_SIZE, b, 2));