https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68198
Bug ID: 68198 Summary: Excessive code size, compile time and memory usage bloat due to FSM threading in 453.povray Product: gcc Version: 6.0 Status: UNCONFIRMED Keywords: compile-time-hog, memory-hog Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: ktkachov at gcc dot gnu.org CC: law at redhat dot com Target Milestone: --- Target: arm, aarch64 Created attachment 36642 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36642&action=edit -fmem-report output I see a large compile-time regression building 453.povray from SPEC2006 on arm and aarch64. The file in question is fnpovfpu.cpp. Try compiling it with: arm-none-linux-gnueabihf-g++ -DSPEC_CPU -DNDEBUG -Ofast -mcpu=cortex-a57 -mfpu=neon-vfpv4 -mfloat-abi=hard -mthumb -fno-strict-aliasing -w fnpovfpu.cpp A gcc from around end of Sep 23rd takes about 1.4s to compile the file on my machine. Recent gcc at r229696 takes about 6 and a half minutes and consumes a peak of 9.1GB of memory on an x86_64 host. I'm attaching the -fmem-report I get. The offending function pov::POVFPU_RunDefault is a large switch statement inside a while (true), so I'm suspecting the FSM threading code. The resulting assembly code on arm is so large that it doesn't assemble with many "branch offset out of range" errors. I'm seeing a similar time and space explosion on aarch64. Jeff, could you please take a look?