https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86704

            Bug ID: 86704
           Summary: Segmentation fault when using matmul in combination
                    with transpose
           Product: gcc
           Version: 8.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stanislav.palacek at vsb dot cz
  Target Milestone: ---

Compiled by ifort works properly. With gfortran gives Segmentation fault.
Problem occurs when n=1 and m is greater than 117.

[Standa@localhost PES]$ cat testmatmul.f90 
program testmaticovenasobeni
implicit none

  print*,testmatmul(120,1,3)

  contains

   function testmatmul(m,n,o)
     integer, intent(in) :: m,n,o
     real    :: A(n,m),B(n,o),C(m,o)
     logical :: testmatmul

     call random_number(A)
     call random_number(B)

     C=matmul(transpose(A),B) 
     testmatmul=.true.
   end function 

end program testmaticovenasobeni
[Standa@localhost PES]$ gfortran -v -Wall -Wextra testmatmul.f90 
Driving: gfortran -v -Wall -Wextra testmatmul.f90 -l gfortran -l m
-shared-libgcc
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,fortran,objc,obj-c++,ada,go,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-libmpx
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=generic
--with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.1.1 20180712 (Red Hat 8.1.1-5) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-Wall' '-Wextra' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/libexec/gcc/x86_64-redhat-linux/8/f951 testmatmul.f90 -quiet -dumpbase
testmatmul.f90 -mtune=generic -march=x86-64 -auxbase testmatmul -Wall -Wextra
-version -fintrinsic-modules-path /usr/lib/gcc/x86_64-redhat-linux/8/finclude
-o /tmp/ccJeVFYU.s
GNU Fortran (GCC) version 8.1.1 20180712 (Red Hat 8.1.1-5)
(x86_64-redhat-linux)
        compiled by GNU C version 8.1.1 20180712 (Red Hat 8.1.1-5), GMP version
6.1.2, MPFR version 3.1.6-p2, MPC version 1.0.2, isl version isl-0.16.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran2008 (GCC) version 8.1.1 20180712 (Red Hat 8.1.1-5)
(x86_64-redhat-linux)
        compiled by GNU C version 8.1.1 20180712 (Red Hat 8.1.1-5), GMP version
6.1.2, MPFR version 3.1.6-p2, MPC version 1.0.2, isl version isl-0.16.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
COLLECT_GCC_OPTIONS='-v' '-Wall' '-Wextra' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 as -v --64 -o /tmp/cczpPjh8.o /tmp/ccJeVFYU.s
GNU assembler version 2.29.1 (x86_64-redhat-linux) using BFD version version
2.29.1-23.fc28
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/8/libgfortran.spec
rename spec lib to liborig
COLLECT_GCC_OPTIONS='-v' '-Wall' '-Wextra' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/opt/intel/compilers_and_libraries_2018.3.222/linux/ipp/lib/intel64/:/opt/intel/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64_lin/:/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64_lin/:/opt/intel/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7/:/opt/intel/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7/:/opt/intel/compilers_and_libraries_2018.3.222/linux/daal/lib/intel64_lin/:/opt/intel/compilers_and_libraries_2018.3.222/linux/ipp/lib/intel64/:/opt/intel/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64_lin/:/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64_lin/:/opt/intel/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7/:/opt/intel/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7/:/opt/intel/compilers_and_libraries_2018.3.222/linux/daal/lib/intel64_lin/:/opt/intel/compilers_and_libraries_2018.3.222/linux/daal/../tbb/lib/intel64_lin/gcc4.4/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-Wall' '-Wextra' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/libexec/gcc/x86_64-redhat-linux/8/collect2 -plugin
/usr/libexec/gcc/x86_64-redhat-linux/8/liblto_plugin.so
-plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccTDrZAl.res -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath
-plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id
--no-add-needed --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker
/lib64/ld-linux-x86-64.so.2
/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o
/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-redhat-linux/8/crtbegin.o
-L/usr/lib/gcc/x86_64-redhat-linux/8
-L/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64
-L/opt/intel/compilers_and_libraries_2018.3.222/linux/ipp/lib/intel64
-L/opt/intel/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64_lin
-L/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64_lin
-L/opt/intel/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7
-L/opt/intel/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7
-L/opt/intel/compilers_and_libraries_2018.3.222/linux/daal/lib/intel64_lin
-L/opt/intel/compilers_and_libraries_2018.3.222/linux/ipp/lib/intel64
-L/opt/intel/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64_lin
-L/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64_lin
-L/opt/intel/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7
-L/opt/intel/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7
-L/opt/intel/compilers_and_libraries_2018.3.222/linux/daal/lib/intel64_lin
-L/opt/intel/compilers_and_libraries_2018.3.222/linux/daal/../tbb/lib/intel64_lin/gcc4.4
-L/usr/lib/gcc/x86_64-redhat-linux/8/../../.. /tmp/cczpPjh8.o -lgfortran -lm
-lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/lib/gcc/x86_64-redhat-linux/8/crtend.o
/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crtn.o
COLLECT_GCC_OPTIONS='-v' '-Wall' '-Wextra' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'

Reply via email to