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

--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Sat, Aug 17, 2019 at 08:04:23AM +0000, SameeranJayant.Joshi at amd dot com
wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91471
> 
> --- Comment #2 from Sameeran Joshi <SameeranJayant.Joshi at amd dot com> ---
> (In reply to kargl from comment #1)
> > I have a patch that prevents the ICE.  Remove ICE-on-valid-code
> > tag as the code is invalid.
> 
> It fails when a value is assigned to the allocated space:
> 
> program dynamic
>         implicit none
>         integer,dimension(:), allocatable :: x
>         allocate(x(1))
>         x(1) = 10
>         stop x(1)
> end program dynamic
> 
> Is above ICE-ON-INVALID code ? 
> Can you please specify the reason?
> Thanks
> 

The original code was invalid as you referenced x(1) 
without assigning it a value, i.e., you referenced
an undefined variable. With the patch I will commit
later today, the above code gives

% gfcx -o z a.f90
troutmask:sgk[207] ./z
STOP 10

Reply via email to