]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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)
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

index 3e65e177e7559f62748454eef73ba284816da417..0fcac5b417676177887a7308dd200e515584db2f 100644 (file)
@@ -1,3 +1,13 @@
+2021-10-08  Sandra Loosemore  <sandra@codesourcery.com?
+
+       Backport from master:
+       2021-10-04  Tobias Burnus  <tobias@codesourcery.com>
+
+       PR fortran/54753
+       * resolve.c (can_generate_init, resolve_fl_variable_derived,
+       resolve_symbol): Only do initialization with intent(out) if not
+       inside of an interface block.
+
 2021-10-01  Tobias Burnus  <tobias@codesourcery.com>
 
        Backported from master: