Commit symbol for external BLAS routine when translating MATMUL to *GEMM.
authorThomas Koenig <tkoenig@gcc.gnu.org>
Sat, 9 Nov 2019 14:54:19 +0000 (14:54 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sat, 9 Nov 2019 14:54:19 +0000 (14:54 +0000)
2019-11-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

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

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

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

From-SVN: r278003

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 bf1f8cf3a70a32ba63d613e3da0977c053b55798..449589ba65e60055001c1aa6341828b42728f3a7 100644 (file)
@@ -1,3 +1,9 @@
+2019-11-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/92321
+       * frontend-passes.c (call_external_blas): Commit symbol for
+       external BLAS routine.
+
 2019-11-08  Jakub Jelinek  <jakub@redhat.com>
 
        * arith.c (character2representation): Change i type to size_t.
index 87518b8b7d81ae5b2d3586a15afc8f0f3c4a0e5a..a20d9efa23190b4f9edf11f36717a8afa65740bb 100644 (file)
@@ -4635,6 +4635,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 8ae3ccfcfb6a4935b07924b5619eccb1162689b4..0f8ef38320e072fbcc802cfe0425fccdb8977d0b 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/92321
+       * gfortran.dg/matmul_blas_2.f90: New test.
+
 2019-11-09  Jakub Jelinek  <jakub@redhat.com>
 
        * gfortran.dg/dec_char_conversion_in_assignment_4.f90: Use
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