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

--- Comment #16 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
(In reply to Thomas Koenig from comment #15)
> (In reply to Jerry DeLisle from comment #14)
> > Created attachment 63178 [details]
> > Preliminary patch that partially fixes this
> > 
> > The attached patch detects external file recurise I/O. As noted in the
> > comment, internal units needs to be handled differently. I am still sorting
> > it out. As is, this regression tests OK.
> 
> A few nits/questions:
> 
> I do not think gfc_unit is externally visible, so it might make
> sense to put is_active together with has_size, to save a few bytes.

I will consider this to save space.
> 
> The pre-existing comment for get_gfc_unit_from_unit_root is wrong: It says
> 
> /* get_gfc_unit_from_root()-- Given an integer, return a pointer
>    to the unit structure. Returns NULL if the unit does not exist,
>    otherwise returns a locked unit. */

A lot of the locking mechanisms have been modified since this comment. I will
fix it.

> 
> but no locking is done.  This could be adjusted in the patch.
> 
> Regarding the logic:  I think we have the potential for race conditions
> here.  I would suggest something like (completely untested)
> 

Theoretically this check is done outside of locking sequences. I dont have a
problem adding a trylock and testing it.

--- snip ---

Comments appreciated.

Reply via email to