]> git.ipfire.org Git - thirdparty/gcc.git/commit
hardcfr: support checking at abnormal edges [PR111943]
authorAlexandre Oliva <oliva@adacore.com>
Tue, 31 Oct 2023 12:32:08 +0000 (09:32 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Tue, 31 Oct 2023 12:32:08 +0000 (09:32 -0300)
commit15404016d96dca9132b952980cda24cae33b3ee0
treee6a305430460c73d77ab7a0dbb3811291944c70b
parente3da1d7bb288c8c864f0284bc4bc5877b466a2f7
hardcfr: support checking at abnormal edges [PR111943]

Control flow redundancy may choose abnormal edges for early checking,
but that breaks because we can't insert checks on such edges.

Introduce conditional checking on the dest block of abnormal edges,
and leave it for the optimizer to drop the conditional.

for  gcc/ChangeLog

PR tree-optimization/111943
* gimple-harden-control-flow.cc: Adjust copyright year.
(rt_bb_visited): Add vfalse and vtrue data members.
Zero-initialize them in the ctor.
(rt_bb_visited::insert_exit_check_on_edge): Upon encountering
abnormal edges, insert initializers for vfalse and vtrue on
entry, and insert the check sequence guarded by a conditional
in the dest block.

for  libgcc/ChangeLog

* hardcfr.c: Adjust copyright year.

for  gcc/testsuite/ChangeLog

PR tree-optimization/111943
* gcc.dg/harden-cfr-pr111943.c: New.
gcc/gimple-harden-control-flow.cc
gcc/testsuite/gcc.dg/harden-cfr-pr111943.c [new file with mode: 0644]
libgcc/hardcfr.c