From patchwork Fri Oct 8 14:35:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 46010 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0BB1F385840C for ; Fri, 8 Oct 2021 14:39:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BB1F385840C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1633703994; bh=MFf6BWgWowiBWfiAxEY3FrFAgcsvtz8bNaXwqwmT8Vc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=nWYef8O8M8ZvF48jyLpJEaTvUOHuQWxEtwFQTIgB3ecVkp7RFYFk5kRV4FS5rLVNh zvwElv6FOl74Qle0Y1zWxp/br9JKiQeFAIC36phke4v2piB6GQyrxR5kQQ4B9z3+QS t1Jb872VHvn9ARSGKUx72no886fC434YsySK778E= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 7ED28385840C for ; Fri, 8 Oct 2021 14:39:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7ED28385840C Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-365-ZhgNtiT0NGi5ilbhAJFoDA-1; Fri, 08 Oct 2021 10:39:13 -0400 X-MC-Unique: ZhgNtiT0NGi5ilbhAJFoDA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7EE7910FA2FA for ; Fri, 8 Oct 2021 14:35:46 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.195.97]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 04D3B60C05; Fri, 8 Oct 2021 14:35:45 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.16.1/8.15.2) with ESMTPS id 198EZi3F034561 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 8 Oct 2021 16:35:44 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.16.1/8.16.1/Submit) id 198EZiJ7034560; Fri, 8 Oct 2021 16:35:44 +0200 To: GCC patches Subject: [COMMITTED] Grow non_null_ref bitmap when num_ssa_names increases. Date: Fri, 8 Oct 2021 16:35:18 +0200 Message-Id: <20211008143518.34497-2-aldyh@redhat.com> In-Reply-To: <20211008143518.34497-1-aldyh@redhat.com> References: <20211008143518.34497-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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: Aldy Hernandez via Gcc-patches From: Aldy Hernandez Reply-To: Aldy Hernandez Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" The strlen pass changes the IL as it works with the ranger. This causes the non_null_ref code to sometimes get asked questions about new SSA names. Tested on x86-64 Linux. gcc/ChangeLog: * gimple-range-cache.cc (non_null_ref::non_null_deref_p): Grow bitmap if needed. --- gcc/gimple-range-cache.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc index 7d994798e52..9cbc63d8a40 100644 --- a/gcc/gimple-range-cache.cc +++ b/gcc/gimple-range-cache.cc @@ -61,6 +61,9 @@ non_null_ref::non_null_deref_p (tree name, basic_block bb, bool search_dom) return false; unsigned v = SSA_NAME_VERSION (name); + if (v >= m_nn.length ()) + m_nn.safe_grow_cleared (num_ssa_names + 1); + if (!m_nn[v]) process_name (name);