]> git.ipfire.org Git - thirdparty/gcc.git/commit
Compare loop bounds in ipa-icf
authorJan Hubicka <hubicka@ucw.cz>
Mon, 22 Jul 2024 16:01:57 +0000 (18:01 +0200)
committerJan Hubicka <hubicka@ucw.cz>
Mon, 22 Jul 2024 16:01:57 +0000 (18:01 +0200)
commit0d19fbc7b0760ce665fa6a88cd40cfa0311358d7
tree684617d9af1cb99c43cabf1408e8b3c9a0ad555c
parent34f33ea801563e2eabb348e8d3e9344a91abfd48
Compare loop bounds in ipa-icf

Hi,
this testcase shows another poblem with missing comparators for metadata
in ICF. With value ranges available to loop optimizations during early
opts we can estimate number of iterations based on guarding condition that
can be split away by the fnsplit pass. This patch disables ICF when
number of iteraitons does not match.

Bootstrapped/regtesed x86_64-linux, will commit it shortly

gcc/ChangeLog:

PR ipa/115277
* ipa-icf-gimple.cc (func_checker::compare_loops): compare loop
bounds.

gcc/testsuite/ChangeLog:

* gcc.c-torture/compile/pr115277.c: New test.
gcc/ipa-icf-gimple.cc
gcc/testsuite/gcc.c-torture/compile/pr115277.c [new file with mode: 0644]