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/68226] New: ICE on wrong assignment of function pointer to allocatable


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

            Bug ID: 68226
           Summary: ICE on wrong assignment of function pointer to
                    allocatable
           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: ---

This wrong code :

$ cat z1.f90
program p
   type t
      integer :: n
   end type
   type(t), allocatable :: a(:)
   a = f()
contains
   function f() result(r)
      class(t), pointer :: r(:)
      type(t), target :: b(2) = [t(1), t(2)]
      r => b
   end
end


$ gfortran -g -O0 -Wall -fcheck=all z1.f90
z1.f90:6:7:

    a = f()
       1
Warning: POINTER-valued function appears on right-hand side of assignment at
(1) [-Wsurprising]
z1.f90:6:0:

    a = f()
 1
internal compiler error: in gfc_trans_arrayfunc_assign, at
fortran/trans-expr.c:8315

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