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

--- Comment #7 from Gerhard Steinmetz <gerhard.steinmetz.fort...@t-online.de> 
---
> The ICEs should only happen with --enabled-checking.
Correct.


Here is a small reproducer (wrong code) to experiment with :

$ cat z1.f90
subroutine s(x)
   integer :: x(:)
   integer :: n = size(lbound(x))
end


Should give a regular error :

$ gfortran-6 -frepack-arrays -Warray-temporaries -c z1.f90
z1.f90:4:0:

 end

Warning: Creating array temporary at (1) [-Warray-temporaries]



In contrast :

$ cat z0.f90
subroutine s(x)
   integer :: x(:)
   integer :: n = sum(lbound(x))
end

$ gfortran-6 -frepack-arrays -Warray-temporaries -c z0.f90
z0.f90:3:29:

    integer :: n = sum(lbound(x))
                             1
Error: Deferred array 'x' at (1) is not permitted in an initialization
expression

Reply via email to