https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67779
--- Comment #11 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- Created attachment 37182 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37182&action=edit More simplified test case This illustrates the problem - the array is passed wrong on the first call to the subroutine. Output: array on input 5 1 4 3 2 array on input 1 4 3 2 array on input 1 4 3 array on input 1 4 array on input 1