https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31059
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gcc dot gnu.org --- Comment #9 from anlauf at gcc dot gnu.org --- Created attachment 55821 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55821&action=edit Partial patch (proof of concept) The attached patch adds bounds-checking for the case that the r.h.s. has only an array constructor. Note the the original testcase is bogus, as it does not prevent (re)allocation on assignment, which became default in F2003. Adjusted testcase: program p integer :: jvec(3) = [1,2,3] integer, allocatable :: ivec(:) allocate (ivec(2)) ivec(:) = [4,5,6] ! shall be detected ivec(:) = jvec ! already detected end