]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Commit symbol for external BLAS routine when translating MATMUL to *GEMM.
authorThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 10 Nov 2019 09:34:42 +0000 (09:34 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 10 Nov 2019 09:34:42 +0000 (09:34 +0000)
2019-11-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

Backport from trunk
PR fortran/92321
* frontend-passes.c (call_external_blas): Commit symbol for
external BLAS routine.

2019-11-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

Backport from trunk
PR fortran/92321
* gfortran.dg/matmul_blas_2.f90: New test.

From-SVN: r278014

gcc/fortran/ChangeLog
gcc/fortran/frontend-passes.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/matmul_blas_2.f90 [new file with mode: 0644]

index 1ace227a91ffd31e96130b70db0aafd30b5f27da..307f8ba5a18c93d80984e4e45ae647f044502166 100644 (file)
@@ -1,3 +1,10 @@
+2019-11-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       Backport from trunk
+       PR fortran/92321
+       * frontend-passes.c (call_external_blas): Commit symbol for
+       external BLAS routine.
+
 2019-11-08  Tobias Burnus  <tobias@codesourcery.com
 
        Backport from mainline
index e6786635788fe36756bd423230f21a4b553ed579..ec374b684e0ae8dc52e7eaba06f0a198d1828ff7 100644 (file)
@@ -4637,6 +4637,7 @@ call_external_blas (gfc_code **c, int *walk_subtrees ATTRIBUTE_UNUSED,
   call->symtree->n.sym->attr.procedure = 1;
   call->symtree->n.sym->attr.flavor = FL_PROCEDURE;
   call->resolved_sym = call->symtree->n.sym;
+  gfc_commit_symbol (call->resolved_sym);
 
   /* Argument TRANSA.  */
   next = gfc_get_actual_arglist ();
index 90948e8ee3a285317905515134f641d4c5684132..304b40517ddbd6b6af9f1ce3cb84299578e415ac 100644 (file)
@@ -1,3 +1,9 @@
+2019-11-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       Backport from trunk
+       PR fortran/92321
+       * gfortran.dg/matmul_blas_2.f90: New test.
+
 2019-11-08  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/92384
diff --git a/gcc/testsuite/gfortran.dg/matmul_blas_2.f90 b/gcc/testsuite/gfortran.dg/matmul_blas_2.f90
new file mode 100644 (file)
index 0000000..237f4a1
--- /dev/null
@@ -0,0 +1,25 @@
+! { dg-do compile }
+! { dg-options "-O3 -fdump-tree-original -fexternal-blas" }
+! PR fortran/92321 - this used to cause an ICE.  Original test case
+! by Nathan Wukie.
+
+module mod_badmatmul
+    implicit none
+contains
+
+    subroutine test(c)
+        real, intent(inout) :: c(3,3)
+        real :: a(3,3), b(3,3)
+        c = matmul(a, b)
+    end subroutine test
+
+end module mod_badmatmul
+
+program main
+    use mod_badmatmul, only: test
+    implicit none
+
+    real :: a(3,3)
+    call test(a)
+
+end program main