https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110167
Bug ID: 110167
Summary: excessive compile time when optimizing std::to_array
Product: gcc
Version: 13.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: nightstrike at gmail dot com
Target Milestone: ---
#include <array>
int f[262144]; auto g(void) { return std::to_array(f); }
(Thanks to Andrew for help reducing!)
Baseline run:
$ time g++ test.cc -std=gnu++20 -O0 -c
real 0m17.274s
user 0m16.806s
sys 0m0.119s
at -O1, 2, 3, or fast, it takes too long to ever finish. I killed it after 15
minutes.
For the curious, that array size is 512*512. I didn't bisect to see where it
starts to blow up.