[Bug fortran/119136] Printing result of function that prints itself hangs

jvdelisle at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 30 21:18:41 GMT 2025


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

--- Comment #19 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
I realized after thinking a little bit more.

The following variation of TRYLOCK does work:

          if (TRYLOCK(&p->lock) && (p->child_dtio == 0))
            {
              generate_error (&dtp->common, LIBERROR_RECURSIVE_IO, NULL);
              return;
            }
          //if (p->is_active && (p->child_dtio == 0))
            //generate_error (&dtp->common, LIBERROR_RECURSIVE_IO, NULL);
          //else
            //p->is_active = true;


We have to exclude DTIO child I/O as this is allowed and we do not need a new
flag.

Running target unix

                === gfortran Summary ===

# of expected passes            74702
# of expected failures          343
# of unsupported tests          82

I prefer this simpler approach.


More information about the Gcc-bugs mailing list