This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/55402] Compiling large initializer lists never finishes


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55402

Hasnain Lakhani <m.hasnain.lakhani at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |m.hasnain.lakhani at gmail dot com

--- Comment #13 from Hasnain Lakhani <m.hasnain.lakhani at gmail dot com> ---
I ran into this just now with GCC 4.8; and a coworker verified that the problem
is still there in gcc-6.0-pre.

My file (slow.cpp), which contains a huge map literal takes 630 seconds to
compile with gcc 4.8, while the same code would compile in 16 seconds with
clang.

Additionally it seems to compile fine if changing the generated code to instead
use assignment (which was fine for our purposes as a workaround) rather than a
huge initializer list; which suggests exponential behaviour. That would compile
in 30 seconds with gcc 4.8 and under a second with clang.

I'm attaching the two above mentioned files.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]