public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/115491] New: Internal compiler error: in resolve_typebound_procedure, at fortran/resolve.cc:14913
@ 2024-06-14 13:25 heinzell at ucar dot edu
  2024-06-14 17:19 ` [Bug fortran/115491] " kargls at comcast dot net
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: heinzell at ucar dot edu @ 2024-06-14 13:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115491
           Summary: Internal compiler error: in
                    resolve_typebound_procedure, at
                    fortran/resolve.cc:14913
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: heinzell at ucar dot edu
  Target Milestone: ---

I am working on a fairly complicated modeling code used by the U.S. Naval
Research Lab and I am hitting internal compiler errors that prevent us from
using gcc. I tested versions 10 through 14 (14.1.0), all with the same results.
It's going to be complicated to resolve, since I cannot share the code, but
hopefully we can find a way to address the problem.

This is the failing compile command in full glory. I added the flags you
recommended in your buz filing instructions. I can remove essentially all the
compiler flags, set the optimization to -O0 or any other value, remove all but
one include flag and remove all the preprocessor flags (see below) and I get
the same error:
$ /home/dom/prod/gcc-14.1.0-manual/bin/gfortran -c -fopenmp
-fmax-stack-var-size=65536 -fno-strict-aliasing -fwrapv
-fno-aggressive-loop-optimizations -g -fpic -ffree-line-length-none -Wall
-Wextra -Wconversion -Wno-unused -Wno-unused-dummy-argument -fbacktrace
-fimplicit-none -fcheck=array-temps,bounds,do,mem,recursion
-fallow-argument-mismatch -fallow-invalid-boz -fno-range-check
-Wno-c-binding-type -freport-bug -save-temps \
[a bunch of -I include dirs] \
[a bunch of custom preprocessor flags -DXYZ...] \
 /home/dom/work/neptune_atmos/neptune_atmos_gcc/src/cgc_submod.F90 -o
/home/dom/work/neptune_atmos/neptune_atmos_gcc/objdir/cgc_submod.o 
 f951: Warning: Flag ‘-fmax-stack-var-size=65536’ overwrites ‘-frecursive’
implied by ‘-fopenmp’
f951: internal compiler error: in resolve_typebound_procedure, at
fortran/resolve.cc:14913
0x75c0ee resolve_typebound_procedure
        ../.././gcc/fortran/resolve.cc:14913
0x8a2799 do_traverse_symtree
        ../.././gcc/fortran/symbol.cc:4301
0x878fc7 resolve_typebound_procedures
        ../.././gcc/fortran/resolve.cc:15178
0x878fc7 resolve_fl_derived
        ../.././gcc/fortran/resolve.cc:15976
0x87557f resolve_symbol
        ../.././gcc/fortran/resolve.cc:16370
0x8a2752 do_traverse_symtree
        ../.././gcc/fortran/symbol.cc:4295
0x882d76 resolve_types
        ../.././gcc/fortran/resolve.cc:18332
0x88908c gfc_resolve(gfc_namespace*)
        ../.././gcc/fortran/resolve.cc:18452
0x875a93 resolve_symbol
        ../.././gcc/fortran/resolve.cc:17007
0x8a2752 do_traverse_symtree
        ../.././gcc/fortran/symbol.cc:4295
0x882d76 resolve_types
        ../.././gcc/fortran/resolve.cc:18332
0x882e1f resolve_types
        ../.././gcc/fortran/resolve.cc:18346
0x88908c gfc_resolve(gfc_namespace*)
        ../.././gcc/fortran/resolve.cc:18452
0x86686f gfc_parse_file()
        ../.././gcc/fortran/parse.cc:7240
0x8c1d4f gfc_be_parse_file
        ../.././gcc/fortran/f95-lang.cc:241
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

The simplified compile command gives:
/home/dom/prod/gcc-14.1.0-manual/bin/gfortran -c -g -O0
/home/dom/work/neptune_atmos/neptune_atmos_gcc/src/cgc_submod.F90 -o
/home/dom/work/neptune_atmos/neptune_atmos_gcc/objdir/cgc_submod.o
-I/home/dom/work/neptune_atmos/neptune_atmos_gcc/objdir
f951: internal compiler error: in resolve_typebound_procedure, at
fortran/resolve.cc:14913
0x75c0ee resolve_typebound_procedure
        ../.././gcc/fortran/resolve.cc:14913
0x8a2799 do_traverse_symtree
        ../.././gcc/fortran/symbol.cc:4301
0x878fc7 resolve_typebound_procedures
        ../.././gcc/fortran/resolve.cc:15178
0x878fc7 resolve_fl_derived
        ../.././gcc/fortran/resolve.cc:15976
0x87557f resolve_symbol
        ../.././gcc/fortran/resolve.cc:16370
0x8a2752 do_traverse_symtree
        ../.././gcc/fortran/symbol.cc:4295
0x882d76 resolve_types
        ../.././gcc/fortran/resolve.cc:18332
0x88908c gfc_resolve(gfc_namespace*)
        ../.././gcc/fortran/resolve.cc:18452
0x875a93 resolve_symbol
        ../.././gcc/fortran/resolve.cc:17007
0x8a2752 do_traverse_symtree
        ../.././gcc/fortran/symbol.cc:4295
0x882d76 resolve_types
        ../.././gcc/fortran/resolve.cc:18332
0x882e1f resolve_types
        ../.././gcc/fortran/resolve.cc:18346
0x88908c gfc_resolve(gfc_namespace*)
        ../.././gcc/fortran/resolve.cc:18452
0x86686f gfc_parse_file()
        ../.././gcc/fortran/parse.cc:7240
0x8c1d4f gfc_be_parse_file
        ../.././gcc/fortran/f95-lang.cc:241
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Since I cannot share the code and wasn't able to come up with a simple
reproducer yet (it's fairly complicated code using a lot of Fortran 2008 stuff,
including Fortran submodules), I am hoping to get some pointers on what I
should try. For instance, I don't even know which line in the source file it is
tripping over.

I appreciate your help very much! Thanks.

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

* [Bug fortran/115491] Internal compiler error: in resolve_typebound_procedure, at fortran/resolve.cc:14913
  2024-06-14 13:25 [Bug fortran/115491] New: Internal compiler error: in resolve_typebound_procedure, at fortran/resolve.cc:14913 heinzell at ucar dot edu
@ 2024-06-14 17:19 ` kargls at comcast dot net
  2024-06-14 21:18 ` heinzell at ucar dot edu
  2024-06-15  0:05 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: kargls at comcast dot net @ 2024-06-14 17:19 UTC (permalink / raw)
  To: gcc-bugs

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

kargls at comcast dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargls at comcast dot net

--- Comment #1 from kargls at comcast dot net ---
(In reply to Dom Heinzeller from comment #0)
> I am working on a fairly complicated modeling code used by the U.S. Naval
> Research Lab and I am hitting internal compiler errors that prevent us from
> using gcc. I tested versions 10 through 14 (14.1.0), all with the same
> results. It's going to be complicated to resolve, since I cannot share the
> code, but hopefully we can find a way to address the problem.

It seems you'll need to do some old fashion debugging for us.
Compile your code.  With the problematic file that causes the ICE,
you'll need to start commenting out chunks.  Hopefully, you
can isolate a small example, which can then be posted here.

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

* [Bug fortran/115491] Internal compiler error: in resolve_typebound_procedure, at fortran/resolve.cc:14913
  2024-06-14 13:25 [Bug fortran/115491] New: Internal compiler error: in resolve_typebound_procedure, at fortran/resolve.cc:14913 heinzell at ucar dot edu
  2024-06-14 17:19 ` [Bug fortran/115491] " kargls at comcast dot net
@ 2024-06-14 21:18 ` heinzell at ucar dot edu
  2024-06-15  0:05 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: heinzell at ucar dot edu @ 2024-06-14 21:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Dom Heinzeller <heinzell at ucar dot edu> ---
(In reply to kargls from comment #1)
> (In reply to Dom Heinzeller from comment #0)
> > I am working on a fairly complicated modeling code used by the U.S. Naval
> > Research Lab and I am hitting internal compiler errors that prevent us from
> > using gcc. I tested versions 10 through 14 (14.1.0), all with the same
> > results. It's going to be complicated to resolve, since I cannot share the
> > code, but hopefully we can find a way to address the problem.
> 
> It seems you'll need to do some old fashion debugging for us.
> Compile your code.  With the problematic file that causes the ICE,
> you'll need to start commenting out chunks.  Hopefully, you
> can isolate a small example, which can then be posted here.

Thanks! That is what I started early today, and I do indeed have an update. I
can get the code to compile if I change the location of Fortran "use"
statements. Basically, it looks like this in the failing code:

module abc
...
end module abc

submodule (abc) def
contains
  module procedure xyz
    use some_overloaded_procedure ! an interface for several type-bound
procedures
    ...
  end module procedure xyz
end submodule def

This code, however, works:

module abc
...
end module abc

submodule (abc) def
  use some_overloaded_procedure ! an interface for several type-bound
procedures
contains
  module procedure xyz
    ...
  end module procedure xyz
end submodule def

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

* [Bug fortran/115491] Internal compiler error: in resolve_typebound_procedure, at fortran/resolve.cc:14913
  2024-06-14 13:25 [Bug fortran/115491] New: Internal compiler error: in resolve_typebound_procedure, at fortran/resolve.cc:14913 heinzell at ucar dot edu
  2024-06-14 17:19 ` [Bug fortran/115491] " kargls at comcast dot net
  2024-06-14 21:18 ` heinzell at ucar dot edu
@ 2024-06-15  0:05 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-15  0:05 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-06-15
             Status|UNCONFIRMED                 |WAITING

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
You can use something like delta to reduce the sources.
https://github.com/dsw/delta

I usually use that instead of something like cvise
(https://gcc.gnu.org/wiki/A_guide_to_testcase_reduction
https://github.com/marxin/cvise) because it just does it based on the text file
rather than based on C/C++ tokens (and expressions); basically delta can handle
Fortran code too.

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

end of thread, other threads:[~2024-06-15  0:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-14 13:25 [Bug fortran/115491] New: Internal compiler error: in resolve_typebound_procedure, at fortran/resolve.cc:14913 heinzell at ucar dot edu
2024-06-14 17:19 ` [Bug fortran/115491] " kargls at comcast dot net
2024-06-14 21:18 ` heinzell at ucar dot edu
2024-06-15  0:05 ` pinskia 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).