diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 69c0fe8e5e67bf63f0e0a768ed9ba23b42fce225..9b616c2af3a6025ed89e32bdba8ed272cc496aac 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2012-09-06 Tobias Burnus + + PR fortran/54463 + * trans-intrinsic.c (gfc_conv_intrinsic_funcall): Fix matmul + call to BLAS if the default-kind has been promoted. + 2012-09-05 Tobias Burnus <burnus@net-b.de> PR fortran/54462 diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index add4baaa3118598b2beb8c02ea56d0f97e82c8cf..4b268b34ba7aef26ab87137335fad15ed540b5bb 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -2362,21 +2362,20 @@ gfc_conv_intrinsic_funcall (gfc_se * se, gfc_expr * expr) if (gfc_option.flag_external_blas && (sym->ts.type == BT_REAL || sym->ts.type == BT_COMPLEX) - && (sym->ts.kind == gfc_default_real_kind - || sym->ts.kind == gfc_default_double_kind)) + && (sym->ts.kind == 4 || sym->ts.kind == 8)) { tree gemm_fndecl; if (sym->ts.type == BT_REAL) { - if (sym->ts.kind == gfc_default_real_kind) + if (sym->ts.kind == 4) gemm_fndecl = gfor_fndecl_sgemm; else gemm_fndecl = gfor_fndecl_dgemm; } else { - if (sym->ts.kind == gfc_default_real_kind) + if (sym->ts.kind == 4) gemm_fndecl = gfor_fndecl_cgemm; else gemm_fndecl = gfor_fndecl_zgemm; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c33fddce09707d9257f0dd59feaed5143a45d75e..7089b59b1efefa70fea462b7b46356507701ed29 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-09-06 Tobias Burnus + + PR fortran/54463 + * gfortran.dg/promotion_2.f90: New. + 2012-09-05 Jakub Jelinek <jakub@redhat.com> PR middle-end/54486 diff --git a/gcc/testsuite/gfortran.dg/promotion_2.f90 b/gcc/testsuite/gfortran.dg/promotion_2.f90 new file mode 100644 index 0000000000000000000000000000000000000000..3acf249705c021d8a31e176b435a139ecb782f75 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/promotion_2.f90 @@ -0,0 +1,16 @@ +! { dg-do compile } +! { dg-options "-fdefault-real-8 -fexternal-blas -fdump-tree-original" } +! +! PR fortran/54463 +! +! Contributed by Simon Reinhardt +! +program test + implicit none + real, dimension(3,3) :: A + A = matmul(A,A) +end program test + +! { dg-final { scan-tree-dump-times "sgemm_" 0 "original" } } +! { dg-final { scan-tree-dump-times "dgemm_" 1 "original" } } +! { dg-final { cleanup-tree-dump "original" } }