https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88132
Bug ID: 88132 Summary: Compile time and memory hog w/ var-tracking on 32-bit targets Product: gcc Version: unknown Status: UNCONFIRMED Keywords: compile-time-hog, memory-hog Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com Target Milestone: --- Target: powerpc-*-linux-gnu, powerpcspe-*-linux-gnu gcc-9.0.0-alpha20181118 snapshot (r266255) exhibits disproportionally large time and memory consumption compiling the following snippet w/ -O1 -fipa-ra -fpeel-loops -fno-dce -fno-tree-dce -fno-tree-forwprop -g: void c6 (unsigned int an) { int te; for (te = 0; te < 16; ++te) an %= 7; } % timeout 10 powerpc-e300c3-linux-gnu-gcc-9.0.0-alpha20181118 -O1 -fipa-ra -fpeel-loops -fno-dce -fno-tree-dce -fno-tree-forwprop -g -c fztr7tmm.c zsh: exit 124 timeout 10 powerpc-e300c3-linux-gnu-gcc-9.0.0-alpha20181118 -O1 -fipa-ra -fpeel-loops Compilation time grows roughly exponentially depending on the upper bound of `te', at least in the range from 9 to 17. Adding -fno-var-tracking to the command line helps. As this is var-tracking-related, there might be earlier reports of this issue already, though I failed to find one the w/ similar profile. perf top reads like this most of the time, w/ lra_substitute_pseudo and add_regs_to_insn_regno_info alternating perpetually: Overhead Sha Symbol 50.79% cc1 [.] lra_substitute_pseudo 41.93% cc1 [.] add_regs_to_insn_regno_info 4.22% cc1 [.] bitmap_set_bit 1.35% cc1 [.] expand_reg_info 1.24% cc1 [.] read_modify_subreg_p 0.46% cc1 [.] max_reg_num