[Bug fortran/70149] New: Character pointer initialization causes ICE. (F2008)

w6ws at earthlink dot net gcc-bugzilla@gcc.gnu.org
Wed Mar 9 01:27:00 GMT 2016


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

            Bug ID: 70149
           Summary: Character pointer initialization causes ICE.  (F2008)
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: w6ws at earthlink dot net
  Target Milestone: ---

The following causes an ICE on both 5.8.4 and the 20160309 6.0 trunk:

module myptr_mod
  implicit none

  integer, target, save :: int_data = 42
  character(16), target, save :: char_data = 'forty two'

  integer, pointer :: number => int_data
! The following works:
!  character(16), pointer :: number_string => char_data

! The following causes a compiler ICE:
  character(:), pointer :: number_string => char_data

end module


wws@w6ws-4:/tmp$ gfortran --version
GNU Fortran (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

wws@w6ws-4:/tmp$ gfortran -c ptr_init_ice.f90
f951: internal compiler error: in gfc_get_symbol_decl, at
fortran/trans-decl.c:1449
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
wws@w6ws-4:/tmp$ 

and

wws@w6ws-4:/tmp$ /usr/local/bin/gfortran_trunk --version 
GNU Fortran (GCC) 6.0.0 20160309 (experimental)
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

wws@w6ws-4:/tmp$ /usr/local/bin/gfortran_trunk -c ptr_init_ice.f90
f951: internal compiler error: in gfc_get_symbol_decl, at
fortran/trans-decl.c:1636
0x691703 gfc_get_symbol_decl(gfc_symbol*)
        ../../gcc-trunk/gcc/fortran/trans-decl.c:1636
0x696fa9 gfc_create_module_variable
        ../../gcc-trunk/gcc/fortran/trans-decl.c:4648
0x650323 do_traverse_symtree
        ../../gcc-trunk/gcc/fortran/symbol.c:3817
0x694772 gfc_generate_module_vars(gfc_namespace*)
        ../../gcc-trunk/gcc/fortran/trans-decl.c:5091
0x66a72b gfc_generate_module_code(gfc_namespace*)
        ../../gcc-trunk/gcc/fortran/trans.c:2032
0x621b35 translate_all_program_units
        ../../gcc-trunk/gcc/fortran/parse.c:5600
0x621b35 gfc_parse_file()
        ../../gcc-trunk/gcc/fortran/parse.c:5819
0x663032 gfc_be_parse_file
        ../../gcc-trunk/gcc/fortran/f95-lang.c:201
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
wws@w6ws-4:/tmp$


More information about the Gcc-bugs mailing list