https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93435
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Martin Jambor <jamb...@gcc.gnu.org>: https://gcc.gnu.org/g:29f23ed79b60949fc60f6fdbbd931bd58090b241 commit r10-7309-g29f23ed79b60949fc60f6fdbbd931bd58090b241 Author: Martin Jambor <mjam...@suse.cz> Date: Sat Mar 21 00:21:02 2020 +0100 sra: Cap number of sub-access propagations with a param (PR 93435) PR 93435 is a perfect SRA bomb. It initializes an array of 16 chars element-wise, then uses that to initialize an aggregate that consists of four such arrays, that one to initialize one four times as big as the previous one all the way to an aggregate that has 64kb. This causes the sub-access propagation across assignments to create thousands of byte-sized artificial accesses which are then eligible to be replaced - they do facilitate forward propagation but there is enough of them for DSE to never finish. This patch avoids that situation by accounting how many of such replacements can be created per SRA candidate. The default value of 32 was just the largest power of two that did not slow down compilation of the testcase, but it should also hopefully be big enough for any reasonable input that might rely on the optimization. 2020-03-20 Martin Jambor <mjam...@suse.cz> PR tree-optimization/93435 * params.opt (sra-max-propagations): New parameter. * tree-sra.c (propagation_budget): New variable. (budget_for_propagation_access): New function. (propagate_subaccesses_from_rhs): Use it. (propagate_subaccesses_from_lhs): Likewise. (propagate_all_subaccesses): Set up and destroy propagation_budget. gcc/testsuite/ * gcc.dg/tree-ssa/pr93435.c: New test.