public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/108168] New: ICE in a simple module that almost any change eliminates
@ 2022-12-18 22:53 urbanjost at comcast dot net
  2022-12-19  8:22 ` [Bug fortran/108168] " rguenth at gcc dot gnu.org
  2022-12-19  8:43 ` marxin at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: urbanjost at comcast dot net @ 2022-12-18 22:53 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/108168] ICE in a simple module that almost any change eliminates
  2022-12-18 22:53 [Bug fortran/108168] New: ICE in a simple module that almost any change eliminates urbanjost at comcast dot net
@ 2022-12-19  8:22 ` rguenth at gcc dot gnu.org
  2022-12-19  8:43 ` marxin at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-12-19  8:22 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-12-19
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING
      Known to work|                            |10.4.0, 11.3.0, 12.1.0
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |11.1.0, 11.2.0

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I can't reproduce on the top of the GCC 11 branch, can you please try updating
the compiler to 11.3.0 at least?

For me it reproduces with GCC 11.1 and 11.2 but not with 11.3 which means it
appears fixed.  Proper backtrace:

f951: internal compiler error: Segmentation fault
0xc27c3f crash_signal
        /space/rguenther/src/gcc-11-branch/gcc/toplev.c:327
0x745c60 gfc_sym_get_dummy_args(gfc_symbol*)
        /space/rguenther/src/gcc-11-branch/gcc/fortran/symbol.c:5256
0x7e25f9 doloop_contained_procedure_code
        /space/rguenther/src/gcc-11-branch/gcc/fortran/frontend-passes.c:2483
0x7e96e9 gfc_code_walker(gfc_code**, int (*)(gfc_code**, int*, void*), int
(*)(gfc_expr**, int*, void*), void*)
        /space/rguenther/src/gcc-11-branch/gcc/fortran/frontend-passes.c:5333
0x7eb0b8 doloop_code
        /space/rguenther/src/gcc-11-branch/gcc/fortran/frontend-passes.c:2627
0x7e96e9 gfc_code_walker(gfc_code**, int (*)(gfc_code**, int*, void*), int
(*)(gfc_expr**, int*, void*), void*)
        /space/rguenther/src/gcc-11-branch/gcc/fortran/frontend-passes.c:5333
0x7e97fe gfc_code_walker(gfc_code**, int (*)(gfc_code**, int*, void*), int
(*)(gfc_expr**, int*, void*), void*)
        /space/rguenther/src/gcc-11-branch/gcc/fortran/frontend-passes.c:5657
0x7ea92b doloop_warn
        /space/rguenther/src/gcc-11-branch/gcc/fortran/frontend-passes.c:3059
0x7eae1a gfc_run_passes(gfc_namespace*)
        /space/rguenther/src/gcc-11-branch/gcc/fortran/frontend-passes.c:156
0x70e567 gfc_resolve(gfc_namespace*)
        /space/rguenther/src/gcc-11-branch/gcc/fortran/resolve.c:17445
0x70e567 gfc_resolve(gfc_namespace*)
        /space/rguenther/src/gcc-11-branch/gcc/fortran/resolve.c:17418
0x70ea29 update_current_proc_array_outer_dependency
        /space/rguenther/src/gcc-11-branch/gcc/fortran/resolve.c:3123
0x719a27 resolve_call
        /space/rguenther/src/gcc-11-branch/gcc/fortran/resolve.c:3750

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/108168] ICE in a simple module that almost any change eliminates
  2022-12-18 22:53 [Bug fortran/108168] New: ICE in a simple module that almost any change eliminates urbanjost at comcast dot net
  2022-12-19  8:22 ` [Bug fortran/108168] " rguenth at gcc dot gnu.org
@ 2022-12-19  8:43 ` marxin at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-12-19  8:43 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |FIXED
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed on master with r12-5847-gb77968a70537429b and yes, gcc 11.3.0 fixed that.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-19  8:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-18 22:53 [Bug fortran/108168] New: ICE in a simple module that almost any change eliminates urbanjost at comcast dot net
2022-12-19  8:22 ` [Bug fortran/108168] " rguenth at gcc dot gnu.org
2022-12-19  8:43 ` marxin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).