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

G. Steinmetz <gs...@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code

--- Comment #1 from G. Steinmetz <gs...@t-online.de> ---

Some cases with small numbers :

$ cat zz1.f90
program p
   character :: c = 'c'
   integer :: i = -1
   c = 'abc'(i:i)
   print *, c
end

$ cat zz2.f90
program p
   character :: c = 'c'
   integer :: i = -123
   c = 'abc'(i:i)
   print *, c
end

$ gfortran-11-20210221 zz1.f90 -O2 && ./a.out

$ gfortran-11-20210221 zz2.f90 -O2 && ./a.out
 c


---

The value at which the switchover from no-ICE to ICE occurs 
depends on used options, and changes with gfortran versions 
and environment, e.g.

$ cat za.f90   # no-ICE
program p
   character :: c
   integer :: i = -1800000
   c = 'abc'(i:i)
   print *, c
end

$ cat zb.f90   # ICE
program p
   character :: c
   integer :: i = -1900000
   c = 'abc'(i:i)
   print *, c
end

Reply via email to