From patchwork Tue Sep 21 16:53:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 45249 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 5E5203858439 for ; Tue, 21 Sep 2021 17:00:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E5203858439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1632243630; bh=32R3fQZZUdvg1eVtYP8Y7BIGezuU4+WLMqmYc4KtKnA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=POUZ3B8qpIt4JmDeO8soT++Ahj8q0uVDZkje7ejyRJxGp/5syU/h4kdj3M6vGZiAX PqAyg9s+463qL6BZ7QuG3Fmn5FvWvTLL5MazapeUflpI0PDty0e9X0uaTRUDjVWAqW 4a39Iw0EOkb7GZfMQ3CgFFruFg3A+c/Qy3r/j69I= 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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id D678B3858005 for ; Tue, 21 Sep 2021 16:54:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D678B3858005 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-92-cNCLg7_KMRemNv1ixhX5nA-1; Tue, 21 Sep 2021 12:54:09 -0400 X-MC-Unique: cNCLg7_KMRemNv1ixhX5nA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 365FF1018F62; Tue, 21 Sep 2021 16:54:08 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.248]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C0B3E1024873; Tue, 21 Sep 2021 16:54:07 +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 18LGs5m0414667 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 21 Sep 2021 18:54:05 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.16.1/8.16.1/Submit) id 18LGs5iY414666; Tue, 21 Sep 2021 18:54:05 +0200 To: Andrew MacLeod Subject: [PATCH 2/7] Do not query SCEV in range_of_phi unless dominators are available. Date: Tue, 21 Sep 2021 18:53:45 +0200 Message-Id: <20210921165350.414593-3-aldyh@redhat.com> In-Reply-To: <20210921165350.414593-1-aldyh@redhat.com> References: <20210921165350.414593-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.8 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 Cc: GCC patches Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" SCEV won't work without dominators and we can get called without dominators from debug_ranger. Another option would be to rename scev_initialized_p to something like scev_available_p and move the check there. For now, this will do. Committed. gcc/ChangeLog: * gimple-range-fold.cc (fold_using_range::range_of_phi): Check dom_info_available_p. --- gcc/gimple-range-fold.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc index 997d02dd4b9..4dbf4188ec2 100644 --- a/gcc/gimple-range-fold.cc +++ b/gcc/gimple-range-fold.cc @@ -781,7 +781,9 @@ fold_using_range::range_of_phi (irange &r, gphi *phi, fur_source &src) } // If SCEV is available, query if this PHI has any knonwn values. - if (scev_initialized_p () && !POINTER_TYPE_P (TREE_TYPE (phi_def))) + if (dom_info_available_p (CDI_DOMINATORS) + && scev_initialized_p () + && !POINTER_TYPE_P (TREE_TYPE (phi_def))) { value_range loop_range; class loop *l = loop_containing_stmt (phi);