aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-openmp.cc
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2022-10-06 10:04:52 -0400
committerPatrick Palka <ppalka@redhat.com>2022-10-06 10:04:52 -0400
commit09df0d8b14dda66c5159a1b2cf85b73f26282152 (patch)
tree9758930d46b0e4aae5170aaf5343e542f89f46c1 /gcc/fortran/trans-openmp.cc
parent3ec926d36fbf7cb3ff45759471139f3a71d1c4de (diff)
downloadgcc-09df0d8b14dda66c5159a1b2cf85b73f26282152.zip
gcc-09df0d8b14dda66c5159a1b2cf85b73f26282152.tar.gz
gcc-09df0d8b14dda66c5159a1b2cf85b73f26282152.tar.bz2
c++: remove optimize_specialization_lookup_p
Roughly speaking, optimize_specialization_lookup_p returns true for a non-template member function of a class template, e.g. template<class T> struct A { int f(); }; The idea behind the optimization guarded by this predicate is that if we want to look up the specialization A<T>::f [with T=int], then we can just do a name lookup for f in A<int> and avoid having to add a spec_entry for f in the decl_specializations table. But the benefit of this optimization seems questionable because in order to do the name lookup we first need to look up A<T> [with T=int] in the type_specializations table, which is as expensive as the decl_specializations lookup we're avoiding. And according to some experiments (using stdc++.h, range-v3 and libstdc++ tests) the compiler is slightly (<1%) _faster_ if we disable this optimization. Additionally, this optimization means we won't record an explicit specialization in decl_specializations for such a template either, which is an unfortunate inconsistency that apparently breaks the below modules testcase. So since this optimization doesn't improve performance, and complicates the explicit specialization story which causes issues with modules, this patch proposes to remove it. gcc/cp/ChangeLog: * pt.cc (optimize_specialization_lookup_p): Remove. (retrieve_specialization): Assume the above returns false and simplify accordingly. (register_specialization): Likewise. gcc/testsuite/ChangeLog: * g++.dg/modules/indirect-3_b.C: Expect that the entity foo::TPL<0>::frob is tagged as a specialization instead of as a declaration. * g++.dg/modules/tpl-spec-8_a.H: New test. * g++.dg/modules/tpl-spec-8_b.C: New test.
Diffstat (limited to 'gcc/fortran/trans-openmp.cc')
0 files changed, 0 insertions, 0 deletions