https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115165
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Nathaniel Shead <nsh...@gcc.gnu.org>: https://gcc.gnu.org/g:b7b2434cc7e712dc5055bde02c441393ae881f06 commit r15-2121-gb7b2434cc7e712dc5055bde02c441393ae881f06 Author: Nathaniel Shead <nathanielosh...@gmail.com> Date: Sun Jul 7 23:19:52 2024 +1000 c++/modules: Conditionally start timer during lazy load [PR115165] While lazy loading, instantiation of pendings can sometimes recursively perform name lookup and begin further lazy loading. When using the '-ftime-report' functionality this causes ICEs as we could start an already-running timer for the importing. This patch fixes the issue by using the 'timevar_cond*' API instead to support such recursive calls. PR c++/115165 gcc/cp/ChangeLog: * module.cc (lazy_load_binding): Use 'timevar_cond*' APIs. (lazy_load_pendings): Likewise. gcc/testsuite/ChangeLog: * g++.dg/modules/timevar-1_a.H: New test. * g++.dg/modules/timevar-1_b.C: New test. Signed-off-by: Nathaniel Shead <nathanielosh...@gmail.com>