Commit 6c6bde30 by Thomas Koenig

re PR fortran/56342 (MATMUL with PARAMETER: Simplification usually doesn't work)

2017-10-27  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/56342
	* simplify.c (is_constant_array_expr): If the expression is
	a parameter array, call gfc_simplify_expr.

2017-10-27  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/56342
	* gfortran.dg/matmul_const.f90: New test.

From-SVN: r254157
parent a09ca93a
2017-10-27 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/56342
* simplify.c (is_constant_array_expr): If the expression is
a parameter array, call gfc_simplify_expr.
2017-10-25 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
* match.c (gfc_match_type_is): Fix typo in error message.
......
......@@ -227,7 +227,8 @@ convert_boz (gfc_expr *x, int kind)
}
/* Test that the expression is an constant array. */
/* Test that the expression is an constant array, simplifying if
we are dealing with a parameter array. */
static bool
is_constant_array_expr (gfc_expr *e)
......@@ -237,6 +238,10 @@ is_constant_array_expr (gfc_expr *e)
if (e == NULL)
return true;
if (e->expr_type == EXPR_VARIABLE && e->rank > 0
&& e->symtree->n.sym->attr.flavor == FL_PARAMETER)
gfc_simplify_expr (e, 1);
if (e->expr_type != EXPR_ARRAY || !gfc_is_constant_expr (e))
return false;
......
2017-10-27 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/56342
* gfortran.dg/matmul_const.f90: New test.
2017-10-25 Jan Hubicka <hubicka@ucw.cz>
* gcc.target/i386/pr70021.c: Add -mtune=skylake.
......
! { dg-do run }
! { dg-additional-options "-fno-frontend-optimize -fdump-tree-original" }
program main
integer, parameter :: A(3,2) = reshape([1,2,3,4,5,6],[3,2])
integer, parameter :: B(2,3) = reshape([1,1,1,1,1,1],[2,3])
character (len=30) :: line
write (unit=line,fmt='(9i3)') matmul(A,B)
if (line /= ' 5 7 9 5 7 9 5 7 9') call abort
end program main
! dg-final { scan-tree-dump-times "matmul_i4" 0 "original" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment