public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/114022] New: ICE with a complex part%ref and nested structure constructor of complex array.
@ 2024-02-20 21:13 kargl at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: kargl at gcc dot gnu.org @ 2024-02-20 21:13 UTC (permalink / raw)
  To: gcc-bugs

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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-20 21:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-20 21:13 [Bug fortran/114022] New: ICE with a complex part%ref and nested structure constructor of complex array kargl 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).