This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, libgfortran] Remove recursion check
- From: Thomas Koenig <tkoenig at netcologne dot de>
- To: Jerry DeLisle <jvdelisle at charter dot net>, Janne Blomqvist <blomqvist dot janne at gmail dot com>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 6 Oct 2018 19:55:02 +0200
- Subject: Re: [PATCH, libgfortran] Remove recursion check
- References: <20180924085658.26505-1-blomqvist.janne@gmail.com> <1563ef8d-8aef-ac3b-cee5-58428db71f35@netcologne.de> <CAO9iq9FBxQ+OB_N4wU8i=uhKKQVp1XmO0tYyV1zdZmL2gEO9kg@mail.gmail.com> <CAO9iq9FcfvPiW+jqkh6wEk+bkJmvn5ypPKft3jaGhD61A8W_Jg@mail.gmail.com> <978e3b38-cc02-65c1-a0b6-2a9bf77a8f9b@charter.net>
Hi Jerry,
Agree it should be fixed. I would think a mutex lock should work. Lock,
issue error message, unlock. Even if there is recursion, since there is
at least one error somewhere, It should be OK to pause the world to
issue the error, and come back and finish. AS I think about it, maybe
one global lock variable so that only one thread can get it at a time
and others wait until it is unlcoked to proceed with their lock and error.
Would there be a problem with some sort of endless loop waiting for the
unlock?
I think that as long as we
a) make the lock recursive
b) make sure to unlock it afterwards
we should be fine, we also should not enter an endless loop on
the rare case of aa double error.
I can prepare a patch, unless somebody else wants to do it.
Regards
Thomas