2012-09-06 Tobias Burnus
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Sep 2012 07:03:42 +0000 (07:03 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Sep 2012 07:03:42 +0000 (07:03 +0000)
        PR fortran/54463
        * trans-intrinsic.c (gfc_conv_intrinsic_funcall): Fix matmul
        call to BLAS if the default-kind has been promoted.

2012-09-06  Tobias Burnus

        PR fortran/54463
        * gfortran.dg/promotion_2.f90: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191012 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/trans-intrinsic.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/promotion_2.f90 [new file with mode: 0644]

index 69c0fe8..9b616c2 100644 (file)
@@ -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
index add4baa..4b268b3 100644 (file)
@@ -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;
index c33fddc..7089b59 100644 (file)
@@ -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 (file)
index 0000000..3acf249
--- /dev/null
@@ -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" } }