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

            Bug ID: 83633
           Summary: gfortran internal compiler error for explicit-shape
                    array with non-constant bounds
           Product: gcc
           Version: 7.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: weeks at iastate dot edu
  Target Milestone: ---

The following (invalid) 3-line Fortran code triggers an internal compiler error
in gfortran 7.1.0. The following output is from the Cray-provided version on
the NERSC Cori supercomputer, though I've reproduced it on macOS with MacPorts
GCC 7.2.0.

========================================
$ cat internal_compiler_error.f90
integer :: A(command_argument_count()) = 1 
write (*,*) A
end
$ gfortran internal_compiler_error.f90 
internal_compiler_error.f90:1:0:

 integer :: A(command_argument_count()) = 1 

internal compiler error: Segmentation fault
0xad23bf crash_signal
    ../../cray-gcc-7.1.0-201705230545.65f29659747b4/gcc/toplev.c:337
0x6d3748 gfc_conv_array_initializer(tree_node*, gfc_expr*)
   
../../cray-gcc-7.1.0-201705230545.65f29659747b4/gcc/fortran/trans-array.c:5701
0x6fd6d0 gfc_conv_initializer(gfc_expr*, gfc_typespec*, tree_node*, bool, bool,
bool)
   
../../cray-gcc-7.1.0-201705230545.65f29659747b4/gcc/fortran/trans-expr.c:6793
0x6e2dc1 gfc_get_symbol_decl(gfc_symbol*)
   
../../cray-gcc-7.1.0-201705230545.65f29659747b4/gcc/fortran/trans-decl.c:1800
0x6e57d7 generate_local_decl
   
../../cray-gcc-7.1.0-201705230545.65f29659747b4/gcc/fortran/trans-decl.c:5403
0x6abef2 do_traverse_symtree
    ../../cray-gcc-7.1.0-201705230545.65f29659747b4/gcc/fortran/symbol.c:4009
0x6e644a generate_local_vars
   
../../cray-gcc-7.1.0-201705230545.65f29659747b4/gcc/fortran/trans-decl.c:5603
0x6e644a gfc_generate_function_code(gfc_namespace*)
   
../../cray-gcc-7.1.0-201705230545.65f29659747b4/gcc/fortran/trans-decl.c:6267
0x67add6 translate_all_program_units
    ../../cray-gcc-7.1.0-201705230545.65f29659747b4/gcc/fortran/parse.c:6074
0x67add6 gfc_parse_file()
    ../../cray-gcc-7.1.0-201705230545.65f29659747b4/gcc/fortran/parse.c:6274
0x6bde2f gfc_be_parse_file
    ../../cray-gcc-7.1.0-201705230545.65f29659747b4/gcc/fortran/f95-lang.c:204
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$ gfortran -v
Using built-in specs.
COLLECT_GCC=/opt/gcc/7.1.0/bin/../snos/bin/gfortran
COLLECT_LTO_WRAPPER=/opt/gcc/7.1.0/snos/libexec/gcc/x86_64-suse-linux/7.1.0/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../cray-gcc-7.1.0-201705230545.65f29659747b4/configure
--prefix=/opt/gcc/7.1.0/snos --disable-nls --libdir=/opt/gcc/7.1.0/snos/lib
--enable-languages=c,c++,fortran
--with-gxx-include-dir=/opt/gcc/7.1.0/snos/include/g++
--with-slibdir=/opt/gcc/7.1.0/snos/lib --with-system-zlib --enable-shared
--enable-__cxa_atexit --build=x86_64-suse-linux --with-ppl --with-cloog
--disable-multilib
Thread model: posix
gcc version 7.1.0 20170502 (Cray Inc.) (GCC)
========================================

Reply via email to