http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50246
Bug #: 50246
Summary: SRA: Writes to class members are not combined
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Pr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50257
Bug #: 50257
Summary: unordered_map slow initialization due to huge
__prime_list
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50257
--- Comment #5 from Justin SB 2011-09-01 17:06:04
UTC ---
Created attachment 25167
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25167
Test case
Test case that stresses unordered_map construction
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50257
--- Comment #6 from Justin SB 2011-09-01 17:33:32
UTC ---
Thanks so much for the help. I created a test case (attached) and tried out
the patch (the second version); it is a big improvement.
Here are the timings:
g++ -g -O3 --std=c++0x test.cc
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50257
--- Comment #9 from Justin SB 2011-09-06 04:04:12
UTC ---
I think I personally prefer the original patches for readability, but I guess
it all depends on what gets optimized away. But that caused me to think: how
about relying on constexpr? We
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50257
--- Comment #15 from Justin SB 2011-09-06 15:55:31
UTC ---
That patch works for me - thanks; gcc optimizes away the array lookup.
I do still think that constexpr could be helpful here: every lookup for an
explicit (or default) unordered_map siz