https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94256
Bug ID: 94256 Summary: Setting max-sched-region-blocks to >48 causes GCC memory usage to explode Product: gcc Version: 9.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: sultan at kerneltoast dot com CC: marxin at gcc dot gnu.org Target Milestone: --- Passing any value greater than 48 for max-sched-region-blocks causes GCC memory usage to explode to the point of hitting the OOM killer. For example, using "--param max-sched-region-blocks=48" causes GCC memory usage to peak at 2 GB for my usecase. Using "--param max-sched-region-blocks=49" causes GCC memory usage to reach the full 32 GB of my machine and causes GCC to be killed. What is most fascinating is that, when I try to recompile GCC from source, setting the default value for max-sched-region-blocks to a number greater than 48 in params.def causes the GCC I'm using to recompile the source to exhibit the same issue, even though I haven't changed the max-sched-region-blocks parameter for my host's GCC. So, an easy way to reproduce the issue would be to: 1. Download GCC source 2. Modify the following code snippet in params.def to change the default value of max-sched-region-blocks to 49: Change this: DEFPARAM(PARAM_MAX_SCHED_REGION_BLOCKS, "max-sched-region-blocks", "The maximum number of blocks in a region to be considered for interblock scheduling.", 10, 0, 0) To: DEFPARAM(PARAM_MAX_SCHED_REGION_BLOCKS, "max-sched-region-blocks", "The maximum number of blocks in a region to be considered for interblock scheduling.", 49, 0, 0) 3. Try to compile your modified GCC source using your host's GCC 4. Your host's GCC will explode in memory usage and die