[Bug c++/125334] [16/17 Regression] basic std module example compile time doubles when <bits/stdc++.h> is built as header unit
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jun 5 21:15:14 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125334
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:c9ada737353ff6ea35766ed4f747edbd732ab5ea
commit r16-9062-gc9ada737353ff6ea35766ed4f747edbd732ab5ea
Author: Patrick Palka <ppalka@redhat.com>
Date: Fri Jun 5 17:05:26 2026 -0400
c++/modules: some dependent ADL fixes
When looking at the stream-in performance regression PR c++/125334
(caused by the dependent ADL patch r16-6311) I spotted some issues with
add_dependent_adl_entities:
1. Fix memory leak in add_dependent_adl_entities when it exits early.
2. Only consider type-dependent calls/operator expressions.
3. Fix early exit test for when all args are type-dependent.
4. Add assert verifying recursive name lookup does not happen with
tentative/dependent ADL since it avoids type completion.
Plugging the memory leak reduces max memory usage by 3% when building
the std module, besides that no significant effect towards the
regression.
gcc/cp/ChangeLog:
* module.cc (dep_adl_info::args): Initializer to nullptr
instead of immediately allocating.
(depset::hash::add_dependent_adl_entities): Exit early
for non-type-dependent calls and operator expressions.
Only allocate dep_adl_info::args if we're not exiting early.
Correct all-type-dependent args test.
* name-lookup.cc (name_lookup::preserve_state): Replace
propagation of tentative flag with assert that it's not
set.
Reviewed-by: Jason Merrill <jason@redhat.com>
(cherry picked from commit b66fd30e4b3943460a6cc030491043502bd3b65d)
More information about the Gcc-bugs
mailing list