]> git.ipfire.org Git - thirdparty/gcc.git/commit
ipa-cp: Fix check for exceeding param_ipa_cp_value_list_size (PR 113490)
authorMartin Jambor <mjambor@suse.cz>
Wed, 24 Jan 2024 15:19:48 +0000 (16:19 +0100)
committerMartin Jambor <mjambor@suse.cz>
Wed, 24 Jan 2024 15:20:18 +0000 (16:20 +0100)
commitbc4a20bc57ce71da0a96bcc6ec5683640b9004d6
tree8ffcd40c8b80916ab0c462339e111beaa6597d57
parente503f9aca9192654d83f141ae7865a3c9d90bf0d
ipa-cp: Fix check for exceeding param_ipa_cp_value_list_size  (PR 113490)

When the check for exceeding param_ipa_cp_value_list_size limit was
modified to be ignored for generating values from self-recursive
calls, it should have been changed from equal to, to equals to or is
greater than.  This omission manifests itself as PR 113490.

When I examined the condition I also noticed that the parameter should
come from the callee rather than the caller, since the value list is
associated with the former and not the latter.  In practice the limit
is of course very likely to be the same, but I fixed this aspect of
the condition too.  I briefly audited all other uses of opt_for_fn in
ipa-cp.cc and all the others looked OK.

gcc/ChangeLog:

2024-01-19  Martin Jambor  <mjambor@suse.cz>

PR ipa/113490
* ipa-cp.cc (ipcp_lattice<valtype>::add_value): Bail out if value
count is equal or greater than the limit.  Use the limit from the
callee.

gcc/testsuite/ChangeLog:

2024-01-22  Martin Jambor  <mjambor@suse.cz>

PR ipa/113490
* gcc.dg/ipa/pr113490.c: New test.
gcc/ipa-cp.cc
gcc/testsuite/gcc.dg/ipa/pr113490.c [new file with mode: 0644]