https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67075
Bug ID: 67075 Summary: Infinite GC loop with ggc-min-expand=0 Product: gcc Version: 4.8.4 Status: UNCONFIRMED Severity: major Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: luke-jr+gccbugs at utopios dot org Target Milestone: --- Created attachment 36100 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36100&action=edit Preprocessed source code to reproduce loop, compressed On a low-memory system, I "need" ggc-min-expand=0 to avoid swapping. However, it appears there are cases where this can lead to an infinite loop of the garbage collector, I presume because more than gcc-min-heapsize memory is actually in use. I did not encounter this in GCC 4.4 or 4.5, but it may have been coincidence, so I am uncertain whether this is a regression or not. I am able to reproduce this consistently with the attached preprocessed source, and either one of these build commands: armv7a-hardfloat-linux-gnueabi-g++ -c -O2 -pipe -mcpu=cortex-a8 -mfpu=vfpv3 -mfloat-abi=hard -mthumb -mthumb-interwork --param ggc-min-expand=0 --param ggc-min-heapsize=32768 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -fPIC x.cpp /usr/libexec/gcc/armv7a-hardfloat-linux-gnueabi/4.8.4/cc1plus -D_GNU_SOURCE x.cpp -dumpbase x.cpp -da -mcpu=cortex-a8 -mfpu=vfpv3 -mfloat-abi=hard -mthumb -mthumb-interwork -mtls-dialect=gnu -auxbase x -O2 -Wall -Wextra -fvisibility=hidden -fvisibility-inlines-hidden -fPIC --param ggc-min-expand=0 --param ggc-min-heapsize=32768 -fstack-protector -o x.out The latter of these verbosely prints: <*free_lang_data> <visibility> <early_local_cleanups> {GC 32770k -> 32172k} {GC 32770k -> 32480k} ............ (~forever)