This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55402] Compiling large initializer lists never finishes
- From: "kevin at topsy dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 Nov 2012 00:24:11 +0000
- Subject: [Bug c++/55402] Compiling large initializer lists never finishes
- Auto-submitted: auto-generated
- References: <bug-55402-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55402
--- Comment #6 from Kevin Hsu <kevin at topsy dot com> 2012-11-20 00:24:11 UTC ---
(In reply to comment #5)
> I don't think it's correct to say that it *never* finishes - the memory usage
> also doesn't diverge - it's just extremely slow. We have of course to analyze
> why (as far as I know nobody tested so far this typical ;) case).
Right, I did test with a few thousand entries, and it did come back. It feels
like there's a exponential issue somewhere... Anyways, thank you for looking
into this :)
The use case we encountered was that we have a global data structure with
around 25,000 pairs known at compile time. So, we naturally generated the code
file. I haven't tested whether this happens at all with std::unordered_map or
other containers.
My workaround was to change the ctor to take a pointer to the entries with a
count. In that case, the C-style initialization compiles in expected time.