From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id B21F53856DD9 for ; Fri, 1 Jul 2022 12:19:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B21F53856DD9 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 792BC1F9F8 for ; Fri, 1 Jul 2022 12:19:38 +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 6453813A20 for ; Fri, 1 Jul 2022 12:19:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 21N8F1rmvmL4KgAAMHmgww (envelope-from ) for ; Fri, 01 Jul 2022 12:19:38 +0000 Date: Fri, 1 Jul 2022 14:19:31 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH 1/2] Make sure checking code is conditional in VN MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Message-Id: <20220701121938.6453813A20@imap2.suse-dmz.suse.de> 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-List-Received-Date: Fri, 01 Jul 2022 12:19:41 -0000 VN has checking code with gcc_unreachable (), the following makes it cheaper by instead guarding the side-effect with flag_checking. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2022-07-01 Richard Biener * tree-ssa-sccvn.cc (vn_nary_op_insert_into): Make checking dominance check conditional on flag_checking. --- gcc/tree-ssa-sccvn.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc index 76d92895a3a..c40c45ed840 100644 --- a/gcc/tree-ssa-sccvn.cc +++ b/gcc/tree-ssa-sccvn.cc @@ -4243,9 +4243,10 @@ vn_nary_op_insert_into (vn_nary_op_t vno, vn_nary_op_table_type *table) if (dominated_by_p (CDI_DOMINATORS, vno_bb, val_bb)) /* Value registered with more generic predicate. */ return *slot; - else if (dominated_by_p (CDI_DOMINATORS, val_bb, vno_bb)) + else if (flag_checking) /* Shouldn't happen, we insert in RPO order. */ - gcc_unreachable (); + gcc_assert (!dominated_by_p (CDI_DOMINATORS, + val_bb, vno_bb)); } /* Append value. */ *next = (vn_pval *) obstack_alloc (&vn_tables_obstack, -- 2.35.3