From 15404016d96dca9132b952980cda24cae33b3ee0 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 31 Oct 2023 09:32:08 -0300 Subject: 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. --- libgcc/hardcfr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/hardcfr.c b/libgcc/hardcfr.c index 7496095..25ff067 100644 --- a/libgcc/hardcfr.c +++ b/libgcc/hardcfr.c @@ -1,5 +1,5 @@ /* Control flow redundancy hardening - Copyright (C) 2022 Free Software Foundation, Inc. + Copyright (C) 2022-2023 Free Software Foundation, Inc. Contributed by Alexandre Oliva This file is part of GCC. -- cgit v1.1