https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68173
Bug ID: 68173 Summary: gcc does not terminate with -O0 on source file with a very large expression Product: gcc Version: 5.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: fuz at fuz dot su Target Milestone: --- Created attachment 36632 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36632&action=edit Testcase (file expands to a 20 MiB C source code form) In this Stack Overflow question [1] OP has trouble compiling a 20 MiB source file with gcc. Testing reveals that the source file compiles in roughly 1½ minutes when compiled with -O3 but the compiler doesn't terminate in 8 hours when compiling with -O0. A reduced and self-contained variation of the source code is attached. Due to its large size, it has been xz-compressed. Other compilers (tested: tcc, clang) do not exhibit this problem and manage to compile the source file within about a minute. The source code comprises a single function with one arithmetic expression making up 99.9% of the entire source file. Please have caution when opening this file with an editor, some editors like nano become unresponsive when reaching the line containing that expression. I'm compiling on amd64 Linux for amd64 Linux with a gcc 5.1 RC1. I do not know if this issue pertains trunk. [1]: http://stackoverflow.com/q/33443626/417501