From patchwork Fri Sep 24 08:16:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1532097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=lc3IMHU4; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HG4d51kWyz9sX3 for ; Fri, 24 Sep 2021 18:16:55 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 497FC3857C65 for ; Fri, 24 Sep 2021 08:16:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 497FC3857C65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1632471413; bh=VHSsEbRsxW/YJo3ycd/T/phULpuN6BodwdkGNM0+iUA=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=lc3IMHU4w7neS3rB7e0MqoZYbIe0X4NGUpI8FDObX7UScecRUbs64GJxoSHlpvkW6 b8O3NYbD+L0ZqCflQctnynfXTeg3vRTOg7I5aiMksKIDntiBZwKp/iGd8ddmr322CN EJm8XhTd1y8IjfBd1zWWcsxDPAZp8ihXF+lgO/Kw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 4511F3858D28 for ; Fri, 24 Sep 2021 08:16:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4511F3858D28 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 094E61FDD4 for ; Fri, 24 Sep 2021 08:16:05 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D78CC139F0 for ; Fri, 24 Sep 2021 08:16:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id xefVMkSJTWHODAAAMHmgww (envelope-from ) for ; Fri, 24 Sep 2021 08:16:04 +0000 Date: Fri, 24 Sep 2021 10:16:04 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] Verify unallocated edge/BB flags are clear Message-ID: <894676n5-66q6-rpnp-74op-1q97p37ns2n5@fhfr.qr> MIME-Version: 1.0 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This adds verification that unused auto_{edge,bb}_flag are not remaining set but correctly cleared by consumers. The intent is that those flags can be cheaply used on a smaller IL region and thus afterwards clearing can be restricted to the same small region as well. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-09-24 Richard Biener * cfghooks.c (verify_flow_info): Verify unallocated BB and edge flags are not set. --- gcc/cfghooks.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c index 50b9b177639..6446e16ca8c 100644 --- a/gcc/cfghooks.c +++ b/gcc/cfghooks.c @@ -161,6 +161,12 @@ verify_flow_info (void) err = 1; } + if (bb->flags & ~cfun->cfg->bb_flags_allocated) + { + error ("verify_flow_info: unallocated flag set on BB %d", bb->index); + err = 1; + } + FOR_EACH_EDGE (e, ei, bb->succs) { if (last_visited [e->dest->index] == bb) @@ -202,6 +208,13 @@ verify_flow_info (void) err = 1; } + if (e->flags & ~cfun->cfg->edge_flags_allocated) + { + error ("verify_flow_info: unallocated edge flag set on %d -> %d", + e->src->index, e->dest->index); + err = 1; + } + edge_checksum[e->dest->index] += (size_t) e; } if (n_fallthru > 1)