http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59146
Bug ID: 59146 Summary: Segfault when ommiting '&' in 'bind (C) ' procedure call Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: minor Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: jean.charles.pa...@o-mail.fr Created attachment 31225 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31225&action=edit test.F90 gFortran ends with a segfault when trying to compile this code (a '&' is missing at the end the 'subroutine' line, so the syntax is incorrect): Begin code --------------------- [test.F90] subroutine f () integer fortran_var interface subroutine c_func (a)& ! works !subroutine c_func (a) ! segfault bind (C, Name="c_func") integer :: a end subroutine c_func end interface call c_func(fortran_var) end subroutine f End code --------------------- [test.F90] Command line: gfortran -v -save-temps -c test.F90 gFortran output: Using built-in specs. COLLECT_GCC=gfortran Target: x86_64-unknown-linux-gnu Configured with: ./configure --prefix=/home/jc/.local_root/ --with-gmp=/home/jc/.local_root/ --with-mpfr=/home/jc/.local_root/ --with-mpc=/home/jc/.local_root/ --with-libelf=/home/jc/.local_root/ --with-cloog=/home/jc/.local_root/ --enable-languages=c,c++,fortran --with-march=corei7-avx --enable-libsanitizer Thread model: posix gcc version 4.8.1 (GCC) COLLECT_GCC_OPTIONS='-c' '-v' '-save-temps' '-mtune=generic' '-march=x86-64' /home/jc/.local_root/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.1/f951 test.F90 -cpp=test.f90 -quiet -v -iprefix /home/jc/.local_root/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.1/ test.F90 -quiet -dumpbase test.F90 -mtune=generic -march=x86-64 -auxbase test -version -fintrinsic-modules-path /home/jc/.local_root/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.1/finclude -o test.s GNU Fortran (GCC) version 4.8.1 (x86_64-unknown-linux-gnu) compiled by GNU C version 4.8.1, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring nonexistent directory "/home/jc/.local_root/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../x86_64-unknown-linux-gnu/include" ignoring duplicate directory "/home/jc/.local_root/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.1/include" ignoring nonexistent directory "/usr/local/include" ignoring duplicate directory "/home/jc/.local_root/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.1/include-fixed" ignoring nonexistent directory "/home/jc/.local_root/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /home/jc/.local_root/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.1/finclude /usr/local/intel/Compiler/12.0/084/composerxe-2011.0.084/mkl/include /usr/local/intel/Compiler/12.0/084/composerxe-2011.0.084/tbb/include /home/jc/.local_root/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.1/include /home/jc/.local_root/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.1/include-fixed /home/jc/.local_root/bin/../lib/gcc/../../include /usr/include End of search list. GNU Fortran (GCC) version 4.8.1 (x86_64-unknown-linux-gnu) compiled by GNU C version 4.8.1, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 COLLECT_GCC_OPTIONS='-c' '-v' '-save-temps' '-mtune=generic' '-march=x86-64' as -v --64 -o test.o test.s GNU assembler version 2.20.51.0.2 (x86_64-redhat-linux) using BFD version version 2.20.51.0.2-5.36.el6 20100205 COMPILER_PATH=/home/jc/.local_root/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.1/:/home/jc/.local_root/bin/../libexec/gcc/ LIBRARY_PATH=/home/jc/.local_root/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.1/:/home/jc/.local_root/bin/../lib/gcc/:/home/jc/.local_root/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/local/intel/Compiler/12.0/084/composerxe-2011.0.084/compiler/lib/intel64/:/usr/local/intel/Compiler/12.0/084/composerxe-2011.0.084/ipp/../compiler/lib/intel64/:/usr/local/intel/Compiler/12.0/084/composerxe-2011.0.084/ipp/lib/intel64/:/usr/local/intel/Compiler/12.0/084/composerxe-2011.0.084/compiler/lib/intel64/:/usr/local/intel/Compiler/12.0/084/composerxe-2011.0.084/mkl/lib/intel64/:/usr/local/intel/Compiler/12.0/084/composerxe-2011.0.084/tbb/lib/intel64//cc4.1.0_libc2.4_kernel2.6.16.21/:/home/jc/.local_root/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-c' '-v' '-save-temps' '-mtune=generic' '-march=x86-64'