From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 9B9B038582A7 for ; Sat, 9 Jul 2022 19:09:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9B9B038582A7 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-587-lFgbFkf-OHaNR0aGvRnAHg-1; Sat, 09 Jul 2022 15:09:24 -0400 X-MC-Unique: lFgbFkf-OHaNR0aGvRnAHg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D84B9811E7A for ; Sat, 9 Jul 2022 19:09:23 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7578E2EF9E; Sat, 9 Jul 2022 19:09:23 +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 269J9LCD323289 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 9 Jul 2022 21:09:21 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 269J9KLD323288; Sat, 9 Jul 2022 21:09:20 +0200 From: Aldy Hernandez To: GCC patches Subject: [COMMITTED] Set VR_VARYING in irange::irange_single_pair_union. Date: Sat, 9 Jul 2022 21:09:16 +0200 Message-Id: <20220709190916.323267-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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=-12.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, SPF_HELO_NONE, SPF_NONE, 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: Sat, 09 Jul 2022 19:09:27 -0000 The fast union operation is sometimes setting a range of the entire domain, but leaving the kind bit as VR_RANGE instead of downgrading it to VR_VARYING. Tested on x86-64 Linux. gcc/ChangeLog: * value-range.cc (irange::irange_single_pair_union): Set VR_VARYING when appropriate. --- gcc/value-range.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 25f1acff4a3..fd549b9ca59 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -1777,11 +1777,7 @@ irange::irange_single_pair_union (const irange &r) // Check for overlap/touching ranges, or single target range. if (m_max_ranges == 1 || wi::to_widest (m_base[1]) + 1 >= wi::to_widest (r.m_base[0])) - { - m_base[1] = r.m_base[1]; - if (varying_compatible_p ()) - m_kind = VR_VARYING; - } + m_base[1] = r.m_base[1]; else { // This is a dual range result. @@ -1789,8 +1785,8 @@ irange::irange_single_pair_union (const irange &r) m_base[3] = r.m_base[1]; m_num_ranges = 2; } - if (flag_checking) - verify_range (); + if (varying_compatible_p ()) + m_kind = VR_VARYING; return true; } @@ -1817,8 +1813,8 @@ irange::irange_single_pair_union (const irange &r) m_base[3] = m_base[1]; m_base[1] = r.m_base[1]; } - if (flag_checking) - verify_range (); + if (varying_compatible_p ()) + m_kind = VR_VARYING; return true; } @@ -1857,6 +1853,8 @@ irange::irange_union (const irange &r) { bool ret = irange_single_pair_union (r); set_nonzero_bits (saved_nz); + if (flag_checking) + verify_range (); return ret || ret_nz; } -- 2.36.1