https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86091
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |WORKSFORME --- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Vasili Burdo from comment #0) > I tried multiple GCC versions starting from 5.3 to 8.0.0 on Ubuntu and > Windows (MINGW) all of them have the same problem. How did you test it with 5.3 when it doesn't even support fold expressions? I can't reproduce the slowness with any version of GCC at all. tmp$ time ~/gcc/6.1.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real 0m0.284s user 0m0.234s sys 0m0.048s tmp$ time ~/gcc/6.1.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real 0m0.267s user 0m0.235s sys 0m0.028s tmp$ time ~/gcc/6.2.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real 0m1.231s user 0m0.271s sys 0m0.081s tmp$ time ~/gcc/6.2.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real 0m0.298s user 0m0.225s sys 0m0.037s tmp$ time ~/gcc/6.3.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real 0m1.260s user 0m0.287s sys 0m0.075s tmp$ time ~/gcc/6.3.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real 0m0.317s user 0m0.230s sys 0m0.034s tmp$ time ~/gcc/6.4.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real 0m0.280s user 0m0.239s sys 0m0.038s tmp$ time ~/gcc/6.4.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real 0m0.264s user 0m0.226s sys 0m0.035s tmp$ time ~/gcc/7.1.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real 0m0.313s user 0m0.254s sys 0m0.056s tmp$ time ~/gcc/7.1.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real 0m0.304s user 0m0.266s sys 0m0.036s tmp$ time ~/gcc/7.2.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real 0m0.299s user 0m0.247s sys 0m0.050s tmp$ time ~/gcc/7.2.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real 0m0.281s user 0m0.245s sys 0m0.034s tmp$ time ~/gcc/7.3.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real 0m0.574s user 0m0.534s sys 0m0.036s tmp$ time ~/gcc/7.3.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real 0m0.632s user 0m0.592s sys 0m0.037s tmp$ time ~/gcc/8.1.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real 0m0.334s user 0m0.305s sys 0m0.027s tmp$ time ~/gcc/8.1.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real 0m0.652s user 0m0.610s sys 0m0.040s tmp$ time ~/gcc/8.2.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real 0m0.169s user 0m0.140s sys 0m0.026s tmp$ time ~/gcc/8.2.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real 0m0.296s user 0m0.249s sys 0m0.043s