[Bug c++/116681] [12/13 Regression] ICE: in start, at timevar.cc:491 with -ftime-report -std=c++20
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Mar 24 07:51:38 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116681
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Simon Martin
<simartin@gcc.gnu.org>:
https://gcc.gnu.org/g:73db20707fd60f303313fda3c9245a06037f312a
commit r13-9448-g73db20707fd60f303313fda3c9245a06037f312a
Author: Simon Martin <simon@nasilyan.com>
Date: Mon Mar 24 08:25:07 2025 +0100
c++: Don't mix timevar_start and auto_cond_timevar for TV_NAME_LOOKUP
[PR116681]
We currently ICE upon the following testcase when using -ftime-report
=== cut here ===
template < int> using __conditional_t = int;
template < typename _Iter >
concept random_access_iterator = requires { new _Iter; };
template < typename _Iterator >
struct reverse_iterator {
using iterator_concept =
__conditional_t< random_access_iterator< _Iterator>>;
};
void RemoveBottom() {
int iter;
for (reverse_iterator< int > iter;;)
;
}
=== cut here ===
The problem is that qualified_namespace_lookup does a plain start() of
the TV_NAME_LOOKUP timer (that asserts that the timer is not already
started). However this timer has already been cond_start()'d in the call
stack - by pushdecl - so the assert fails.
This patch simply ensures that we always conditionally start this timer
(which is done in all other places that use it).
PR c++/116681
gcc/cp/ChangeLog:
* name-lookup.cc (qualified_namespace_lookup): Use an
auto_cond_timer instead of using timevar_start and timevar_stop.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-pr116681.C: New test.
(cherry picked from commit 005f7176e0f457a1e1a7398ddcb4a4972da28c62)
More information about the Gcc-bugs
mailing list