aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorSimon Martin <simon@nasilyan.com>2024-09-13 16:40:22 +0200
committerSimon Martin <simon@nasilyan.com>2024-09-14 15:23:25 +0200
commit005f7176e0f457a1e1a7398ddcb4a4972da28c62 (patch)
tree1ae10616049bfecb91a45087526d1a9573203f51 /gcc/cp
parenta900349485cc4753084527bf0234f173967979b0 (diff)
downloadgcc-005f7176e0f457a1e1a7398ddcb4a4972da28c62.zip
gcc-005f7176e0f457a1e1a7398ddcb4a4972da28c62.tar.gz
gcc-005f7176e0f457a1e1a7398ddcb4a4972da28c62.tar.bz2
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.
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/name-lookup.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc
index bfe17b7..c7a693e 100644
--- a/gcc/cp/name-lookup.cc
+++ b/gcc/cp/name-lookup.cc
@@ -7421,10 +7421,9 @@ tree lookup_qualified_name (tree t, const char *p, LOOK_want w, bool c)
static bool
qualified_namespace_lookup (tree scope, name_lookup *lookup)
{
- timevar_start (TV_NAME_LOOKUP);
+ auto_cond_timevar tv (TV_NAME_LOOKUP);
query_oracle (lookup->name);
bool found = lookup->search_qualified (ORIGINAL_NAMESPACE (scope));
- timevar_stop (TV_NAME_LOOKUP);
return found;
}