http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59806

            Bug ID: 59806
           Summary: ICE with -ggdb AND -finit-real=snan AND namelist
                    variable AND internal procedure
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mrestelli at gmail dot com

Hi all,
   the attached code results in an internal compiler error when
compiled with

gfortran -ggdb -finit-real=snan -c ice.f90

Removing -ggdb and/or -finit-real=snan the code compiles correctly.
Also, removing the namelist containing xx the problem disappears.

(Sorry for the long "summary", could't find a shorter one).

$ gfortran --version
GNU Fortran (GCC) 4.9.0 20140110 (experimental)


$ gfortran -ggdb -finit-real=snan -c ice.f90 
ice.f90: In function ‘prog’:
ice.f90:5:0: internal compiler error: in force_decl_die, at dwarf2out.c:20111
  real :: xx
 ^
0x704d34 force_decl_die
    gcc/dwarf2out.c:20111
0x705207 gen_namelist_decl
    gcc/dwarf2out.c:20632
0x700fd3 gen_decl_die
    gcc/dwarf2out.c:20435
0x71314f decls_for_scope
    gcc/dwarf2out.c:19969
0x6fe0ea gen_subprogram_die
    gcc/dwarf2out.c:18354
0x701014 gen_decl_die
    gcc/dwarf2out.c:20336
0x701df8 dwarf2out_function_decl
    gcc/dwarf2out.c:20776
0x75289c rest_of_handle_final
    gcc/final.c:4469
0x75289c execute
    gcc/final.c:4513




program prog

 implicit none

 real :: xx
 character(len=100) :: message

 ! removing the following line the problem disappears
 namelist /input/ xx

contains

 subroutine check()
  write(message,'(e8.2)') xx
 end subroutine check

end program prog

Reply via email to