https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121743
Bug ID: 121743
Summary: ICE in build_function_decl, at
gcc/fortran/trans-decl.cc:2519
Product: gcc
Version: 15.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gilles.gouaillardet at gmail dot com
Target Milestone: ---
Created attachment 62257
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62257&action=edit
the reproducer
The attached program causes an ICE in build_function_decl with gcc-15.2.0
I noted if the source code is split into two files, then compilation just
works.
$ gfortran -c -fcoarray=lib -freport-bug syncall4.f90
syncall4.f90:77:11:
77 | if(scalar2(1)[i] /= 1) then
| 1
internal compiler error: in build_function_decl, at fortran/trans-decl.cc:2519
0x1e7d37b internal_error(char const*, ...)
../.././gcc/diagnostic-global-context.cc:517
0x7d37a7 fancy_abort(char const*, int, char const*)
../.././gcc/diagnostic.cc:1749
0x9206db build_function_decl
../.././gcc/fortran/trans-decl.cc:2519
0x92a527 gfc_get_symbol_decl(gfc_symbol*)
../.././gcc/fortran/trans-decl.cc:1898
0x9444f3 gfc_conv_variable
../.././gcc/fortran/trans-expr.cc:3194
0x92435b create_caf_accessor_register(stmtblock_t*)
../.././gcc/fortran/trans-decl.cc:6007
0x92450b generate_coarray_init
../.././gcc/fortran/trans-decl.cc:6058
0x92e3eb gfc_generate_function_code(gfc_namespace*)
../.././gcc/fortran/trans-decl.cc:8004
0x92dd3b gfc_generate_contained_functions
../.././gcc/fortran/trans-decl.cc:6170
0x92dd3b gfc_generate_function_code(gfc_namespace*)
../.././gcc/fortran/trans-decl.cc:7998
0x89ccfb translate_all_program_units
../.././gcc/fortran/parse.cc:7432
0x89ccfb gfc_parse_file()
../.././gcc/fortran/parse.cc:7752
0x8f979b gfc_be_parse_file
../.././gcc/fortran/f95-lang.cc:247
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.