[Bug c++/110167] excessive compile time when optimizing std::to_array

2023-06-08 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110167 --- Comment #7 from Jonathan Wakely --- For some value of 1024

[Bug c++/110167] excessive compile time when optimizing std::to_array

2023-06-08 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110167 --- Comment #6 from Jonathan Wakely --- The bottom line, however, is that this use of std::to_array is not really reasonable. You're asking the compiler to create a variadic pack of 262144 integers, and then create a pack expansion for std::arr

[Bug c++/110167] excessive compile time when optimizing std::to_array

2023-06-08 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110167 --- Comment #5 from Jonathan Wakely --- It's hard to bisect where it got slower between 10 and 11, and between 11 and 12, because for --enable-checking builds the extra assertions slow everything down and the difference between "fast with slow a

[Bug c++/110167] excessive compile time when optimizing std::to_array

2023-06-08 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110167 --- Comment #4 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #2) > The "obvious" alternative impl using a lambda expression is even slower: Actually for GCC 13 it's faster: $ time ~/gcc/13/bin/g++ 110167.cc -c -O3 real

[Bug c++/110167] excessive compile time when optimizing std::to_array

2023-06-08 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110167 --- Comment #3 from Jonathan Wakely --- $ time ~/gcc/9/bin/g++ 110167.cc -c -O3 real0m5.568s user0m5.497s sys 0m0.035s $ time ~/gcc/10/bin/g++ 110167.cc -c -O3 real0m5.393s user0m5.355s sys 0m0.028s $ time ~/gcc/11/

[Bug c++/110167] excessive compile time when optimizing std::to_array

2023-06-08 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110167 --- Comment #2 from Jonathan Wakely --- The "obvious" alternative impl using a lambda expression is even slower: template struct array { int data[N]; }; template struct seq { }; #ifndef USE_LAMBDA template array to_array_impl(int (&a)[sizeo

[Bug c++/110167] excessive compile time when optimizing std::to_array

2023-06-08 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110167 Jonathan Wakely changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed|