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

            Bug ID: 108168
           Summary: ICE in a simple module that almost any change
                    eliminates
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: urbanjost at comcast dot net
  Target Milestone: ---

Extracted a reproducer that is only a few lines from a large module, but do not
see what is going on. Even moving the order of the subroutines, declaring i in
the subroutine instead of the top of the module, or just about any change
eliminates the problem, and it does not occur on my machine with version 10 of
gfortran.


module m_module
integer :: i
contains

subroutine subaaa()
   do i=1,2
      call subbbb()
   enddo
end subroutine subaaa

subroutine subbbb()
   call random_number(r)
end subroutine subbbb

subroutine subccc()
      call subaaa()
end subroutine subccc

end module m_module

   gfortran -c M_module.f90
   951: internal compiler error: Segmentation fault
   0x14f925f1108f ???
          
/build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
   0x14f925ef2082 __libc_start_main
           ../csu/libc-start.c:308
   Please submit a full bug report,
   with preprocessed source if appropriate.
   Please include the complete backtrace with any bug report.
   See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions.

   gfortran --version
   GNU Fortran (Ubuntu 11.1.0-1ubuntu1~20.04) 11.1.0
   Copyright (C) 2021 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.

   Linux mercury 5.4.0-132-generic #148-Ubuntu SMP Mon Oct 17 16:02:06 UTC 2022
x86_64 x86_64 x86_64 GNU/Linux

Reply via email to