Fortran: Fix out of bounds access in structure constructor's clean up [PR120711]

A structure constructor's generated clean up code was using an offset
variable, which was manipulated before the clean up was run leading to
an out of bounds access.

	PR fortran/120711

gcc/fortran/ChangeLog:

	* trans-array.cc (gfc_trans_array_ctor_element): Store the value
	of the offset for reuse.

gcc/testsuite/ChangeLog:

	* gfortran.dg/asan/array_constructor_1.f90: New test.

(cherry picked from commit dff66a690f6d47963e5cb96677d0e194b85948fa)
2 files changed