[Bug fortran/68566] ICE on using unusable array in reshape (double free or corruption)
kargl at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Nov 26 20:31:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68566
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #2 from kargl at gcc dot gnu.org ---
(In reply to Gerhard Steinmetz from comment #0)
> Using wrong defined array a :
>
> $ cat z1.f90
> program p
> integer, parameter :: n = 2
> integer, parameter :: a(:) = 0
> integer, parameter :: b(n, n) = reshape([a, 1+a], [n, n])
> end
>
>
> $ gfortran -g -O0 -Wall -fcheck=all z1.f90
> *** Error in `/usr/lib64/gcc/x86_64-suse-linux/5/f951': double free or
> corruption (fasttop): 0x00000000028e93f0 ***
> ...
> f951: internal compiler error: Aborted
With trunk, I get
laptop-kargl:kargl[247] gfc -c c1.f90
c1.f90:3:29:
integer, parameter :: a(:) = 0
1
Error: Parameter array 'a' at (1) cannot be automatic or of deferred shape
More information about the Gcc-bugs
mailing list