]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Avoid var initialization in interfaces [PR54753]
authorTobias Burnus <tobias@codesourcery.com>
Fri, 8 Oct 2021 22:02:31 +0000 (15:02 -0700)
committerSandra Loosemore <sandra@codesourcery.com>
Fri, 8 Oct 2021 22:02:31 +0000 (15:02 -0700)
commit88364f77fb60f84324bfaaa5d1dca2d01c3ee391
tree34b959314e9959c20656b8219d340a2a3755e2d8
parentcb639f7bf2e56acdb3c7832fad5cc15ded7db441
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/ChangeLog.omp