https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106565
--- Comment #4 from Quanhua Liu <quanhua.liu at noaa dot gov> --- Using gfortran -O3 -fexternal-blas -L/..... -lblas testmatrixCal.f90 time a.out 1 real: 6.14 (s) time a.out 2 real: 5.41 It is 6 times slower than BB = transpose(B) C = matmul(A, BB) ifort doesn't have the problem.