diff options
author | Jan Hubicka <jh@suse.cz> | 2023-01-29 01:27:26 +0100 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2023-01-29 01:27:26 +0100 |
commit | da3aca031be736fe4fa8daa57c7efa69dc767160 (patch) | |
tree | cc55eda6e0d584009f8a9a71b1e50ae2a832b912 /gcc/tree-ssa-phiopt.cc | |
parent | ee2c965ee205ae12bc78d8641337380df3b1d3f3 (diff) | |
download | gcc-da3aca031be736fe4fa8daa57c7efa69dc767160.zip gcc-da3aca031be736fe4fa8daa57c7efa69dc767160.tar.gz gcc-da3aca031be736fe4fa8daa57c7efa69dc767160.tar.bz2 |
Fix find_always_executed_bbs handling of infinite loops
This patch fixes the stupid typo info find_always_executed_bbs which made
all edges to be considered as ones closing infinite loops. This fix has
somewhat snowballed as, comparing it to finite_function_p, I noticed a
divergence in handling of volatile asms (find_always_executed_bbs is conservative
and thinks that volatile statement may return or do EH, but it is really
impossible and elsewhere we expects that we dont) and I also noticed
a bug in handling early returns which made some loops to be missed.
I also noticed that function assumes that irreducible loops are marked in CFG
which is not necessarily true and it is easy to detect them during the walk.
Bootstrapped/regtested x86_64-linux, comitted.
gcc/ChangeLog:
2023-01-29 Jan Hubicka <hubicka@ucw.cz>
* ipa-utils.cc: Include calls.h, cfgloop.h and cfganal.h
(stmt_may_terminate_function_p): If assuming return or EH
volatile asm is safe.
(find_always_executed_bbs): Fix handling of terminating BBS and
infinite loops; add debug output.
* tree-ssa-alias.cc (stmt_kills_ref_p): Fix debug output
gcc/testsuite/ChangeLog:
2023-01-29 Jan Hubicka <hubicka@ucw.cz>
* gcc.dg/ipa/ipa-sra-30.c: New test.
* gcc.dg/ipa/ipa-sra-31.c: New test.
* gcc.dg/tree-ssa/modref-dse-7.c: New test.
Diffstat (limited to 'gcc/tree-ssa-phiopt.cc')
0 files changed, 0 insertions, 0 deletions