https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99529
--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> --- (In reply to martin from comment #4) > Ok, here is another suspicious data race in unit.c (backtrace from helgrind): It looks as if - for the libgfortran internal use - it first gets the unit based on that number – and then sets it again. Namely, the call is: unit = get_gfc_unit (dtp->common.unit, do_create); set_internal_unit (dtp, unit, kind); Just to make sure, I add an assert - but I think the line can also be removed for good. --- a/libgfortran/io/unit.c +++ b/libgfortran/io/unit.c @@ -459 +459 @@ set_internal_unit (st_parameter_dt *dtp, gfc_unit *iunit, int kind) - iunit->unit_number = dtp->common.unit; + assert (iunit->unit_number == dtp->common.unit);