https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79876
Bug ID: 79876
Summary: [7 Regression] FAIL: libgomp.fortran/strassen.f90 -O
execution test on x86_64-apple-darwin16
Product: gcc
Version: 7.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: dominiq at lps dot ens.fr
CC: fxcoudert at gcc dot gnu.org, howarth.at.gcc at gmail dot
com,
iains at gcc dot gnu.org, jakub at gcc dot gnu.org,
tkoenig at gcc dot gnu.org
Target Milestone: ---
Host: x86_64-apple-darwin16
Target: x86_64-apple-darwin16
Build: x86_64-apple-darwin16
Since r245745 I see the following failure on x86_64-apple-darwin16 with -m32/64
FAIL: libgomp.fortran/strassen.f90 -O execution test
This is a latent bug exposed by this revisions and which appeared between
revisions r242391 (2016-11-14, OK) and r242872 (2016-11-25, Illegal
instruction) when the test is compiled with -finline-matmul-limit<32 (I didn't
test the 32 values, but only 0, 16, and 31).
% /opt/gcc/gcc7p-242872p3/bin/gfortran -O2 strassen_red.f90
-finline-matmul-limit=31 -fopenmp
% ./a.out
Illegal instruction
The test succeeds with OMP_NUM_THREADS set to 1 on a machine with four cores,
eight threads.
I don't see the failure on another machine with darwin10 and two cores/threads.
The test strassen_red.f90 is
program strassen_matmul
use omp_lib
integer, parameter :: N = 1024
double precision, save :: A(N,N), B(N,N), C(N,N), D(N,N)
double precision :: start, end
call random_seed
call random_number (A)
contains
recursive subroutine strassen (A, B, C, N)
integer, intent(in) :: N
double precision, intent(in) :: A(N,N), B(N,N)
double precision, intent(out) :: C(N,N)
double precision :: T(N/2,N/2,7)
integer :: K, L
if (iand (N,1) .ne. 0 .or. N < 64) then
C = matmul (A, B)
return
end if
K = N / 2
L = N / 2 + 1
!$omp task shared (A, B, T)
call strassen (A(:K,:K) + A(L:,L:), B(:K,:K) + B(L:,L:), T(:,:,1), K)
!$omp end task
!$omp task shared (A, B, T)
call strassen (A(L:,:K) + A(L:,L:), B(:K,:K), T(:,:,2), K)
!$omp end task
!$omp task shared (A, B, T)
call strassen (A(:K,:K), B(:K,L:) - B(L:,L:), T(:,:,3), K)
!$omp end task
!$omp task shared (A, B, T)
call strassen (A(L:,L:), B(L:,:K) - B(:K,:K), T(:,:,4), K)
!$omp end task
!$omp task shared (A, B, T)
call strassen (A(:K,:K) + A(:K,L:), B(L:,L:), T(:,:,5), K)
!$omp end task
!$omp task shared (A, B, T)
call strassen (A(L:,:K) - A(:K,:K), B(:K,:K) + B(:K,L:), T(:,:,6), K)
!$omp end task
!$omp task shared (A, B, T)
call strassen (A(:K,L:) - A(L:,L:), B(L:,:K) + B(L:,L:), T(:,:,7), K)
!$omp end task
!$omp taskwait
C(:K,:K) = T(:,:,1) + T(:,:,4) - T(:,:,5) + T(:,:,7)
C(L:,:K) = T(:,:,2) + T(:,:,4)
C(:K,L:) = T(:,:,3) + T(:,:,5)
C(L:,L:) = T(:,:,1) - T(:,:,2) + T(:,:,3) + T(:,:,6)
end subroutine strassen
end