https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125059

--- Comment #8 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
This seems to fix this:

diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc
index 4b3f75ced71..ae451da04e8 100644
--- a/gcc/fortran/trans-decl.cc
+++ b/gcc/fortran/trans-decl.cc
@@ -764,7 +764,7 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
            && sym->ts.u.derived->attr.has_dtio_procs)
          || (sym->ts.type == BT_CLASS
              && CLASS_DATA (sym)->ts.u.derived->attr.has_dtio_procs)))
-    TREE_STATIC (decl) = 1;
+    TREE_THIS_VOLATILE (decl) = 1;

   /* Treat asynchronous variables the same as volatile, for now.  */
   if (sym->attr.volatile_ || sym->attr.asynchronous)

Almost works:

                === gfortran tests ===


Running target unix
FAIL: gfortran.dg/dtio_4.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/dtio_4.f90   -O3 -g  execution test

                === gfortran Summary ===

# of expected passes            75466
# of unexpected failures        2
# of expected failures          345
# of unsupported tests          85

Not quite right.

Reply via email to