]> gcc.gnu.org Git - gcc.git/commit
Fix looping flag discovery in ipa-pure-const
authorJan Hubicka <jh@suse.cz>
Sat, 20 Nov 2021 23:35:22 +0000 (00:35 +0100)
committerJan Hubicka <jh@suse.cz>
Thu, 25 Nov 2021 09:06:01 +0000 (10:06 +0100)
commit298a4694f89ecb512be8ecba0512558996961fae
tree3c65d2534bac7393f60b7651ad4e21c7edd5fb39
parenta8f772a45c6c65c1062fd270c796bb03c6523ce6
Fix looping flag discovery in ipa-pure-const

The testcase shows situation where there is non-trivial cycle in the callgraph
involving a noreturn call.  This cycle is important for const function discovery
but not important for pure.  IPA pure const uses same strongly connected
components for both propagations which makes it to get suboptimal result
(does not detect the pure flag). However local pure const gets the situation
right becaue it processes functions in right order.  This hits rarely
executed code in propagate_pure_const that merge results with previously
known state that has long standing bug in it that makes it to throw away
the looping flag.

Bootstrapped/regtested x86_64-linux.

gcc/ChangeLog:

2021-11-21  Jan Hubicka  <hubicka@ucw.cz>

PR ipa/103052
* ipa-pure-const.c (propagate_pure_const): Fix merging of loping flag.

gcc/testsuite/ChangeLog:

2021-11-21  Jan Hubicka  <hubicka@ucw.cz>

PR ipa/103052
* gcc.c-torture/execute/pr103052.c: New test.

(cherry picked from commit a0e99d5bb741d3db74a67d492f47b28217fbf88a)
gcc/ipa-pure-const.c
gcc/testsuite/gcc.c-torture/execute/pr103052.c [new file with mode: 0644]
This page took 0.058704 seconds and 6 git commands to generate.