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/66244] ICE on assigning a value to a pointer variable


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

--- Comment #1 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
Perhaps it's better to make the target array a bit larger.
And to provide a not so minimalistic version :

   program p
      integer, target :: a(4)
      integer, pointer :: z => a(3)
      call s
   contains
      subroutine s
         a = 123
         z = 0
         print *, a
         print *, z
      end
   end

yields :
f951: internal compiler error: in lhd_set_decl_assembler_name, at
langhooks.c:179

---

Whereas this modification compiles and works as expected :

$ cat z92.f90
   program p
      integer, target :: a(4)
      integer, pointer :: z
      z => a(3)
      call s
   contains
      subroutine s
         a = 123
         z = 0
         print *, a
         print *, z
      end
   end

$ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-optimize z92.f90
$ a.out
         123         123           0         123
           0


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