https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114022
Bug ID: 114022 Summary: ICE with a complex part%ref and nested structure constructor of complex array. Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: kargl at gcc dot gnu.org Target Milestone: --- Found with the Fujitsu testsuite. The complex part%ref in the first if-stmt leads to an ICE. Likely, the nested structure constructor is not setting the value of zz correctly. ! ! https://github.com/fujitsu/compiler-test-suite ! Reduced from Fortran/0093/0093_0025.f90 ! module m1 type ty complex :: cmp1(2) end type ty type tt type(ty) :: obj end type tt type(tt), parameter :: obj2 = tt(ty([(2,3),(3,5)])) end module m1 use m1, only : obj2 real :: rr(2) = obj2%obj%cmp1%re if (rr(1) .ne. 2) stop 1 if (rr(2) .ne. 3) stop 2 end % gfcx -c 0093/0093_0025.f90 0093/0093_0025.f90:15:22: 15 | use m1, only : obj2 | 1 internal compiler error: Segmentation fault 0x109b292 crash_signal ../../gccx/gcc/toplev.cc:317 0x248c5f37f handle_signal /usr/src/lib/libthr/thread/thr_sig.c:301 0x248c5e9b7 thr_sighandler /usr/src/lib/libthr/thread/thr_sig.c:244 0xa74904 gfc_conv_structure(gfc_se*, gfc_expr*, int) ../../gccx/gcc/fortran/trans-expr.cc:9634 0xa45a6d gfc_conv_array_initializer(tree_node*, gfc_expr*) ../../gccx/gcc/fortran/trans-array.cc:6546 0xa745ab gfc_conv_initializer(gfc_expr*, gfc_typespec*, tree_node*, bool, bool, bool)