Message ID | 20221003110815.1075975-3-aldyh@redhat.com |
---|---|
State | New |
Headers | show
Return-Path: <gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=<UNKNOWN>) Authentication-Results: legolas.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=QjwuAxBa; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mgykm1Crvz23jL for <incoming@patchwork.ozlabs.org>; Mon, 3 Oct 2022 22:08:48 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A15293857811 for <incoming@patchwork.ozlabs.org>; Mon, 3 Oct 2022 11:08:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A15293857811 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664795322; bh=fgVrQ0ffUibp1/rLRq11fE7Xu9/vYWkfebccpTlSAIU=; 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=QjwuAxBaWR1pqyWg6jUq2l8t/GmIt3kYo/Yalr5I5Rlih+5D/HbH0p6P0ntHmKCI5 ZxnVF9plGxSvnhRy6msZUHXzS/JFkykH9fDhpiDXP88lnZwzMLNAz2uPcTV89d5m1F t0uRPeYAujNwd/2Q5bllmv75JoFi4UK8WfeZEHCg= 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 ESMTPS id 86C4F3858401 for <gcc-patches@gcc.gnu.org>; Mon, 3 Oct 2022 11:08:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 86C4F3858401 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-480-3t95F4JCOlme7pYFdclSNQ-1; Mon, 03 Oct 2022 07:08:21 -0400 X-MC-Unique: 3t95F4JCOlme7pYFdclSNQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0FA6C833941 for <gcc-patches@gcc.gnu.org>; Mon, 3 Oct 2022 11:08:21 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.194.103]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72BE940C206B; Mon, 3 Oct 2022 11:08:20 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.1/8.17.1) with ESMTPS id 293B8Jev1076003 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 3 Oct 2022 13:08:19 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 293B8JCl1076002; Mon, 3 Oct 2022 13:08:19 +0200 To: GCC patches <gcc-patches@gcc.gnu.org> Subject: [COMMITTED] Avoid comparing ranges when sub-ranges is 0. Date: Mon, 3 Oct 2022 13:08:14 +0200 Message-Id: <20221003110815.1075975-3-aldyh@redhat.com> In-Reply-To: <20221003110815.1075975-1-aldyh@redhat.com> References: <20221003110815.1075975-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.5 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_NONE, SPF_HELO_NONE, SPF_NONE, TXREP 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Aldy Hernandez via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Aldy Hernandez <aldyh@redhat.com> Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org> |
Series |
[COMMITTED] Avoid comparing ranges when sub-ranges is 0.
|
expand
|
diff --git a/gcc/value-range.cc b/gcc/value-range.cc index ddbcdd67633..e1066f4946e 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -1260,6 +1260,9 @@ irange::operator== (const irange &other) const if (m_num_ranges != other.m_num_ranges) return false; + if (m_num_ranges == 0) + return true; + for (unsigned i = 0; i < m_num_ranges; ++i) { tree lb = tree_lower_bound (i);