This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/68019] New: ICE on rank mismatch of implied-shape array of user-defined type


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

            Bug ID: 68019
           Summary: ICE on rank mismatch of implied-shape array of
                    user-defined type
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gerhard.steinmetz.fortran@t-online.de
  Target Milestone: ---

With a rank mismatch of "arr" :

$ cat z1.f90
program p
   integer :: i
   type t
      integer :: n
   end type
   type(t), parameter :: vec(*) = [(t(i), i = 1, 4)]
   type(t), parameter :: arr(*) = reshape(vec, [2, 2])
end


$ gfortran -g -O0 -Wall -fcheck=all z1.f90
f951: internal compiler error: in add_init_expr_to_sym, at fortran/decl.c:1457

---

Whereas :

$ cat z2.f90
program p
   integer :: i
   integer, parameter :: vec(*) = [(i, i = 1, 4)]
   integer, parameter :: arr(*) = reshape(vec, [2, 2])
end


$ gfortran -g -O0 -Wall -fcheck=all z2.f90
z2.f90:4:31:

    integer, parameter :: arr(*) = reshape(vec, [2, 2])
                               1
Error: Incompatible ranks 1 and 2 in assignment at (1)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]