This works with g95 and ifort but gives a compiler error with gfortran: bash-3.1$ cat bug.F90 program bug
implicit none real, dimension(3,3) :: matA,matB matA(1,:)=(/1., 2., 3./) matA(2,:)=(/4., 5., 6./) matA(3,:)=(/7., 8., 9./) matB=matmul(transpose(0.5*matA),matA) end program bug bash-3.1$ gfortran -v -Wall bug.F90 -o bug Driving: gfortran -v -Wall bug.F90 -o bug -lgfortranbegin -lgfortran -lm -shared-libgcc Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/4.3.3/specs Target: x86_64-slackware-linux Configured with: ../gcc-4.3.3/configure --prefix=/usr --libdir=/usr/lib64 --enable-shared --enable-bootstrap --enable-languages=ada,c,c++,fortran,java,objc --enable-threads=posix --enable-checking=release --with-system-zlib --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp --with-gnu-ld --verbose --disable-multilib --target=x86_64-slackware-linux --build=x86_64-slackware-linux --host=x86_64-slackware-linux Thread model: posix gcc version 4.3.3 (GCC) COLLECT_GCC_OPTIONS='-v' '-Wall' '-o' 'bug' '-shared-libgcc' '-mtune=generic' /usr/libexec/gcc/x86_64-slackware-linux/4.3.3/cc1 -E -lang-fortran -traditional-cpp -D_LANGUAGE_FORTRAN -quiet -v bug.F90 -mtune=generic -Wall -o /tmp/ccLe3BpA.f95 ignoring nonexistent directory "/usr/lib64/gcc/x86_64-slackware-linux/4.3.3/../../../../x86_64-slackware-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/lib64/gcc/x86_64-slackware-linux/4.3.3/include /usr/lib64/gcc/x86_64-slackware-linux/4.3.3/include-fixed /usr/include End of search list. COLLECT_GCC_OPTIONS='-v' '-Wall' '-o' 'bug' '-shared-libgcc' '-mtune=generic' /usr/libexec/gcc/x86_64-slackware-linux/4.3.3/f951 /tmp/ccLe3BpA.f95 -ffree-form -quiet -dumpbase bug.F90 -mtune=generic -auxbase bug -Wall -version -fpreprocessed -fintrinsic-modules-path /usr/lib64/gcc/x86_64-slackware-linux/4.3.3/finclude -o /tmp/ccsYLGw0.s GNU F95 (GCC) version 4.3.3 (x86_64-slackware-linux) compiled by GNU C version 4.3.3, GMP version 4.2.4, MPFR version 2.3.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 bug.F90: In function 'bug': bug.F90:8: internal compiler error: in gfc_conv_array_transpose, at fortran/trans-array.c:734 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. -- Summary: internal compiler error related to matmul and transpose Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: cmklaij at hetnet dot nl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41278