[Bug libfortran/123446] [16 Regression] Build broken since r16-6515-ge32c3fb4311bca for non-__GTHREADS_CXX0X targets
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 8 20:40:45 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123446
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Thomas Koenig <tkoenig@gcc.gnu.org>:
https://gcc.gnu.org/g:d5964a270de33349ff137b1835046e65ec81fa1e
commit r16-6586-gd5964a270de33349ff137b1835046e65ec81fa1e
Author: Thomas Koenig <tkoenig@gcc.gnu.org>
Date: Thu Jan 8 21:35:27 2026 +0100
Fix compile failure on systems not supporting gthreads.
I just realized that it is possible to run a check by #undef - ing
__GTHREADS_CXX0X in async.h. Doing so promptly found another syntax
error, which this version of the patch fixes.
PR libfortran/123446
PR libfortran/119136
libgfortran/ChangeLog:
* io/async.h: DEBUG_ASYNC needs gtreads support.
(LOCK_UNIT): Only lock when there is pthreads support and it is
active.
Otherwise, just set unit->self to 1.
(UNLOCK_UNIT): Only unlock when there is pthreads support and it is
active.
Otherwise, just set unit->self to 0.
(TRYLOCK_UNIT): Only try locking when thee is pthreads support and
it is
active. Otherwise, return unit->self.
(OWN_THREAD_ID): New macro.
* io/io.h: gfc_unit's self is an int when there is no gthreads
support.
* io/unit.c (check_for_recursive): Check for equality of unit which
locked to OWN_THREAD_ID.
More information about the Gcc-bugs
mailing list