This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/50257] [C++0x] unordered_map slow initialization due to huge __prime_list
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 06 Sep 2011 16:37:55 +0000
- Subject: [Bug libstdc++/50257] [C++0x] unordered_map slow initialization due to huge __prime_list
- Auto-submitted: auto-generated
- References: <bug-50257-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50257
--- Comment #16 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-06 16:37:55 UTC ---
If you could have available a complete constexpr implementation of lower_bound,
it would make in principle possible to optimize to a constant all the cases
when it's called from a _M_next_bkt in turn called with constant argument, like
the default constructor or the move constructor, or the constructor taking a
size known at compile-time (Note the *in principle*, see c++/50087). All in
all, seems a bit overkilling to me, considering the memory allocation which
immediately follows. Also, the optimizers may well at some point become able to
do a lot of this anyway via interprocedural constant propagation and
versioning, because the information is all there: as soon as something is
constant at compile-time it "just" needs to be thoroughly propagated.