https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104038
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andrew Macleod <amacl...@gcc.gnu.org>: https://gcc.gnu.org/g:254ada46ae0f21bd6f40314214f969f368328e22 commit r12-6678-g254ada46ae0f21bd6f40314214f969f368328e22 Author: Andrew MacLeod <amacl...@redhat.com> Date: Mon Jan 17 12:03:18 2022 -0500 Limit the number of relations registered per basic block. In pathological cases, the number of transitive relations being added is potentially quadratic. Lookups for relations in a block is linear in nature, so simply limit the number of relations to some reasonable number. PR tree-optimization/104038 * doc/invoke.texi (relation-block-limit): New. * params.opt (relation-block-limit): New. * value-relation.cc (dom_oracle::register_relation): Check for NULL record before invoking transitive registery. (dom_oracle::set_one_relation): Check limit before creating record. (dom_oracle::register_transitives): Stop when no record created. * value-relation.h (relation_chain_head::m_num_relations): New.