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

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

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

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

This invalid variant is accepted, but segfaults at runtime :


$ cat z2.f90
program p
   integer, parameter :: a(2) = [1, 2]
   print *, reshape([3], a)
end


$ gfortran-12-20211114 z2.f90 && ./a.out
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
#...

$ gfortran-12-20211114 z2.f90 -g -O0 -fcheck=all && ./a.out
Fortran runtime error: Incorrect size in SOURCE argument to RESHAPE intrinsic:
is 1, should be 2
#...

Reply via email to