]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Avoid var initialization in interfaces [PR54753]
authorTobias Burnus <tobias@codesourcery.com>
Mon, 4 Oct 2021 07:41:13 +0000 (09:41 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Mon, 4 Oct 2021 07:41:13 +0000 (09:41 +0200)
commit9c003c9c010a29ee910f8395138d2dff9ec35ddb
tree1a55d4f89c976993cc0228d820c0e827c45fdabe
parent0772686ae55dc35cd4b6ec4ec866542a780f0db6
Fortran: Avoid var initialization in interfaces [PR54753]

Intent(out) implies deallocation/default initialization; however, it is
pointless to do this for dummy-arguments symbols of procedures which are
inside an INTERFACE block. – This also fixes a bogus error for the attached
included testcase, but fixing the non-interface version still has to be done.

PR fortran/54753

gcc/fortran/ChangeLog:

* resolve.c (can_generate_init, resolve_fl_variable_derived,
resolve_symbol): Only do initialization with intent(out) if not
inside of an interface block.

(cherry picked from commit 51d9ef7747b2dc439f7456303f0784faf5cdb1d3)
gcc/fortran/resolve.c
gcc/testsuite/gfortran.dg/assumed_rank_23.f90 [new file with mode: 0644]
libgomp/ChangeLog.omp